good bankroll guidelines to follow are:
10x the max buyin for NL ring games
10x the buyin+rake for SnGs
150xBB for fixed limit games.
that's enough money to handle most swings, but in the rare occasion you could actually go through all of that if you get cold cards, go on tilt, etc.
if you're really paranoid, double the above requirements and you should be fine. if you still lose it all, you need to work on your game.