Depends on your winrate, your tolerance for swings and the variance in the game, you are playing. For instance PLO has higher variance than NLH and thus require a larger bankroll. Also most people asking this question are beginners with no track record, and unless you are a winning player, the idea of having a bankroll is meaningless. In that situation you need to think about having a budget instead.
But if you are a winning player, yet somehow know nothing about bankroll management, you can use the tool linked below to determine your required bankroll by plugging in your standard deviation (variance) and winrate. For instance with a 5BB/100 winrate and a standard deviation of 100 (typical for NLH 6-max) the bankroll required for a 5% risk of ruin is around 3.000 BB. So if you are ok accepting a 5% risk of losing all your money, then your required bankroll is 3.000 BB, which for a game with 10c/5c blinds would be $300.
In reality this is a rather theoretical concept for
online poker, since most people well either move down or redeposit way before losing 3.000 BB, and the more important issue is usually tilt after losing a significant portion of the bankroll, which for some people might as little as 25% or whatever. Moreover only people with a lot of experience know their actual winrate. But this is the math and theory behind bankroll management and the numbers, that people toss around.
Poker Variance Calculator for cash games. Analyze Risk of Ruin, Confidence Intervals and other data to protect your poker bankroll.
www.primedope.com