A 401(k) is a retirement savings plan sponsored by an employer. It lets workers save and invest a piece of their paycheck before taxes are taken out. Taxes aren’t paid until the money is withdrawn from the account.

401(k) plans, named for the section of the tax code that governs them, arose during the 1980s as a supplement to pensions. Most employers used to offer pension funds. Pension funds were managed by the employer and they paid out a steady income over the course of the retirement. (If you have a government job or a strong union, you may might sti ll be eligible for a pension.) But as the cost of running pensions escalated, employers started replacing them with 401(k)s.

With a 401(k), you control how your money is invested. Most plans offer a spread of mutual funds composed of stocks, bonds, and money market investments. The most popular option tends to be target-date funds, a combination of stocks and bonds that gradually become more conservative as you reach retirement.

While a 401(k)can help you save, it has plenty of restrictions and caveats. In most cases, you can’t tap into your employer’s contributions immediately. Vesting is the amount of time you must work for your company before gaining access to its payments to your 401(k). (Your payments, on the other hand, vest immediately.) It’s an insurance against employees leaving early. On top of that, there are complex rules about when you can withdraw your money and costly penalties for pulling funds out before retirement age.

To oversee your account, your employer usually hires an administrator like Fidelity Investments. They’ll email you updates about your plan and its performance, manage the paperwork and assist you with requests. If you want to keep watch over your account or shift your money around, go to your administrator’s web site or call their help center.

With that settled, how much should you put in? As much as possible, being mindful that you’ll need to have enough money to live, eat and pay down any debt you have. At the very least, invest enough to get the full matching amount that your company pays to match your contributions. You don’t want to leave free cash on the table. Nearly every plan offers matching funds—the most popular being 3% of your salary, according to the Profit Sharing/401k Council of America.

So how would a 3% match work? If you put in 3% of your $50,000 salary, or $1,500, your company puts another $1,500 in the pot. You can add more than that $1,500 yourself, but the company won’t match beyond 3%. The rules for matching funds vary, so be sure to check with your employer about qualifying for its contributions.

The IRS mandates contribution limits for 401(k) accounts. For 2007 and 2008, the most you can put into your fund is $15,500 in any combination of pre- and after-tax dollars. If you’re older than 49, you can kick in another $5,000. The total dollar amount that can be contributed—including both your contributions and your employers’—cannot exceed 100% of your salary or $46,000 in 2008.

You’ll also want to consider the type of 401(k) you choose. They come in two varieties, the main differences being the tax implications and the schedule for accessing your funds. Chances are your company offers a traditional 401(k). Less common is a Roth 401(k). Here’s the breakdown of each:

401k type Tax rules Withdrawal rules Traditional Wages are contributed before taxes from each paycheck, like a deferred salary. Taxable income drops by the amount you contribute. You pay income taxes on contributions and earnings upon withdrawal. No access to your funds before age 59 ½ or if you leave your employer at age 55 or older. If you dip in early, expect a 10% penalty — on top of the usual tax bill. Roth Contributions are made with money that’s already been taxed. No taxes paid upon withdrawal. Better flexibility: free access to your money as long as you’ve held the account for 5 years.

Most companies allow you to enroll in a 401(k) right away, although some smaller employers might make you wait up to a year. If that’s the case, set up an individual retirement account, and lodge a complaint with your employer’s HR office. Some companies will automatically register you. You can normally increase or decrease your contributions at any time. Don’t forget to elect a beneficiary, or the person who gets your money if you die. (If you’re married, your spouse is automatically the beneficiary.)

Finally, if your company is on shaky ground, don’t fret. Your 401(k) is off-limits. If your company goes under, the plan would most likely be terminated. If that happens, you should roll the money over into a traditional IRA to avoid paying the 10% withdrawal penalty and income taxes.