Bankroll management is a vital skill that all poker players should master, no matter what level or poker game you play. Here's a look at what 'bankroll' actually means.

This is the most important rule. It's always possible to lose money at poker, even if you play well. Therefore you should never risk an amount of money that could get you into financial trouble away from the poker table, especially if you are experiencing a downswing.
For example, if you have $100 in your PokerStars account, you should buy-in for no more than $10 at a cash table. Tournaments with a buy-in of more than $10 should also be avoided. Sticking to this rule means you'll still be in the game even if you lose your money.
If you start playing at a limit that you feel is too high, you should stop - even if you can afford to keep playing. It's easy to get nervous in these situations, which can lead to you no longer enjoying the game and making poor decisions. This should be avoided at all costs, since a competent poker player only plays within the limits in which they feel comfortable.
Even if you play with perfect strategy, there are times when you may experience a losing streak. On the other hand, it is also quite natural to have periods of feeling like you can't lose even if you try! But if you stick to the rules above, you will be able to survive these downswings and upswings, by properly managing your bankroll. Stay confident, make the right plays, and you'll enjoy the game and make profits in the long run.