You also need to take into account the fact that even if you hit your overcard it may not be good. Someone might already have a set or 2 pair, or that card might make them 2 pair.
Example, if the flop is 4 7 9 and you have A8, someone may have A4 A7 or A9 or AJ. So the ace is what they call a dirty out, meaning it improves your hand but might not make you the best hand. Drawing to naked overcards (no other draw) is a generally not advised, you will end up leaking more chips than you ever take in. It's typically -ev (more to come later on more advanced play, such as floating with overs and trying to take the pot away later even if you miss, but for now stay away from doing this).
Now, if you had A8 of spades and the flop was 4s 7h 9s, then you have nine clean outs.
Clean outs are much more valuable than dirty outs, of course. That's why you always want to be drawing to the nuts when you're drawing, cause your outs are always clean. You don't wanna be drawing to the bad end of the straight, or a low flush (there are exceptions of course, there comes a time when the odds are good enough that it is worth it - or if you get good at hand reading and you are reasonably certain your non-nutted outs are clean).
Also to be considered is, if you hit your hand, are you likely to get more money out of your opponent(s). If so, how much? That concept is called implied odds.
So if you have KJs and the flop comes down As 8s 3h, you have 9 clean outs, and are about 36% (if 2 cards to come, your %age is roughly 4 times # outs, if 1 card to come, your %age is roughly 2 times # outs.). So if the betting ended after the flop, the pot should be offering you about 2/1 odds to call. However, let's say the pot is $1 and you and your opponent each have $20 behind. It is worth calling a $2 bet. Even though the pot would only be offering you 3/2 odds (not enough to make it mathematically correct to chase it), there is a reasonable expectation that you will get more on 4th and 5th street if you hit.
So when you are considering calling with a draw, you want to think about your equity (%age chance to win the hand) vs your pot + implied odds.