This is a classic problem in probability called the "Gambler's Ruin". You can find it discussed here:
Gambler's ruin - Wikipedia, the free encyclopedia
See the section titled "Unfair Coin Flipping". If you still have questions after reading Wikipedia, post back and let us know where you are having trouble.