Speaking only in terms of maximizing expected value, the player should play forever. While the probability is 1 that the player will eventually lose, at any given decision point the expected value always favors going again. It seems like a paradox. The answer lies in the fact that some events have a probability of 1, but still may not happen. For example, if you threw a dart at a number line from 0 to 10, the probability of not hitting pi exactly is 1, but it still could happen.
However, for practical purposes, there is some stopping point. This is because the happiness money brings is not proportional to the amount. While it is commonly accepted that more money brings more happiness, the richer you get, the less happiness each additional dollar brings you.
I believe a good way to answer this question is to apply the Kelly Criterion to the problem. According to Kelly, the player should make every decision with the goal of maximizing the expected log of his bankroll after the wager. To cut to the end of this (I cut out a lot of math), the player should keep doubling until the wager amount exceeds 96.5948% of his total wealth. Wealth should be defined as the sum of the amount won plus whatever money the player had before he made the first wager. For example, if the player had $100,000 to start with, he should keep doubling up to 23 times, to a win of $4,194,304. At that point the player’s total wealth will be $4,294,304. He will be asked to wager 4,194,304/4,294,304 = 96.67% of his total wealth, which is greater than the 96.5948% stopping point, so he should quit.