Before you graduate from college and get your first real job, it's good to know about investing in stocks and how you pay taxes on your stock gains or losses. You basically have two options: Retirement plans provide you a tax-deferred way to invest your money to prepare for retirement. Brokerage accounts allow you to invest in stocks and earn money for the present, but you'll have to pay taxes on the money you make.

Paying Long-Term Gains

You pay taxes on long-term gains when you hold a stock for 12 months or more. If you buy a stock for $20 and over a two-year period it climbs to $25, you owe tax on the gain of $5 if you sell it. Your gain is not realized until you sell the stock that has increased in value. Most new investors are better off buying a stock that's likely to go up and holding it for an extended period. You only want to put money into an investment account -- especially a taxable investment account -- that you don't need for a long time. This minimizes your tax consequences.

Paying Ordinary Income Taxes

As you get older and make more money, you'll have to file income taxes. The Internal Revenue Service refers to these as ordinary income taxes. As of 2013, you don't have to pay taxes until you earn more than $6,100 if your parents claim you as a dependent or $10,000 if you file your own taxes. You pay a percentage of your earnings as tax, and your tax rate increases as your pay goes up. Short-term capital gains -- investment gains you earn by buying and selling stocks within one year -- are taxed at the same rate as your ordinary income. Your ordinary income tax rate normally exceeds the long-term capital gain rate -- especially as you get older and earn more at your job.

Investing in Retirement

When you get your first career-type job, you may get the chance to invest in an employer-sponsored retirement account, particularly if you work for a large company. If your employer does not offer a plan, you can open your own individual retirement account, or IRA, through a brokerage firm or bank. These qualified accounts allow you to invest your money before you pay taxes, and your investment grows without having any taxes taken out until you withdraw the money. If you take your savings out before you turn 59 1/2, you'll pay ordinary income taxes and an extra 10 percent penalty for early withdrawal. There’s one exception: Roth IRAs are funded with after-tax dollars, and you don’t get taxed when you take money out.

Starting to Invest

You have to reach 18 to open your own investment account, but you can start a joint account with a parent or guardian before then. When you open your own investment account, it's a good idea to start funding your tax-deferred retirement account first. After you do that, you can take any leftover money and open a taxable investment account for buying and holding stocks for more than a year. It's wise to avoid buying and selling stocks on a short-term basis. This is usually reserved for professional investors and sophisticated investors who have the time and know-how to do so successfully, as it's a risky way to make money and an easy way to lose it.