There's two variables here:
1) Whether we are on the flop or on the turn: obviously with two cards to come you have more chance of hitting one of your outs
2) Whether you are looking purely at the chance that you will hit one of your outs or whether you take killer cards into account.
Suppose on the flop you have a draw and I have a set. You have x outs, so the chance you hit on the turn is x/41 (assuming opponent has no blockers). Thus if x>20 you are more than 50% to hit your hand on the turn. In case you miss, you still have a shot on the river of x/40.
Combined, this means that you have a chance of
p=chance (you hit turn) OR (you miss turn AND you hit river):
p = x/41 plus [(1-x/41) times x/40].
If you put p=.5 and solve for x then you will find the number of outs you need to be 50% to hit on either street.
If we take killer cards into account, then we have to use the formula
p= chance (you hit on turn AND opponent misses river) OR
(you miss turn AND opponent misses turn AND you hit river):
p= [x/41 times 30/40] plus [(1-x/41) times 33/40 times x/40],
where the 30/40 comes from the fact that opponent has 10 outs and thus misses 30/40 times, and where the 33/40 that he has 3 boat outs less on the flop.
Again you can solve for x, putting p=.5 and then I think you get x=17 (didn't check myself, am at work).
When in doubt, shove in your stack.