After the river is dealt, you either win or lose. The best you can do is "count" how many hands in the villain's range have you beat you and how many don't.
There is no quick way of knowing what your "percentage" is, otherwise poker would be a very easy game and nobody would play it. As a quick rule of thumb, when you have a draw.
After the turn is dealt, estimate your "outs" (number of cards that would complete your hand) and multiply by 2
After the flop is dealt (before the turn), estimate your "outs" and multiply by 4 (this will be slightly off when you have too many outs, but still works OK)
As for preflop hands, with 5 cards to come, calculating on the spot would be too hard, so it's better to just remember some "reference points", then increase it slightly if cards are suited or well connected:
90%: AA vs A7........... KK vs K5 and alike
80%: QQ vs J7............ 55 vs 32 and alike
70%: AJ vs A9............ J9 vs J3 and alike
70%: QQ vs K9............ 77 vs Q3 and alike
60%: AJ vs K9............ J9 vs 43 (closer to 65-ish) and alike
50%: 22 vs 89............. 99 vs AK and alike