Happy man leaning back in chair © g-stockstudio/Shutterstock.com

The 401(k) plan, formed in 1978, is one of the most popular types of employer-sponsored retirement plans in the United States.

A 401(k) is funded by employee contributions that are deducted directly from the employee’s paycheck. Many companies proportionately match contributions up to a certain percentage. Most employee contributions are pretax and grow tax-deferred until withdrawn, but after-tax contributions are also allowed.

Here are 5 things you need to know about 401(k) plans.

1. How much to contribute?

One of the first considerations is how much money to contribute. Generally speaking, you should contribute as much as you can. You don’t want to leave yourself cash-strapped, but you also don’t want to squander the opportunity to make pretax, tax-deferred contributions and get a company match. Whether your company match is dollar-for-dollar or something smaller, don’t pass up free money.

For 2016, the maximum pretax annual contribution an employee may make is $18,000 ($24,000 if you’re 50 or older). The annual contribution may increase in future years, depending on the cost of living.

2. How to invest?

Employees are responsible for their 401(k) investment decisions. Most plans have an array of mutual funds to choose from, but too often there is little guidance as to proper asset allocation and the role fees and expenses play in overall returns.

RATE SEARCH:Compare saving rates on Bankrate.

Before you can decide how to allocate your contributions, you have to determine your risk tolerance. How much volatility within the portfolio can you stand?

If you’re in your 20s or early 30s you can afford to be more aggressive with your investments because you have more time to recover from slumps in the stock market. As you age, your asset allocation should shift to more conservative investments to protect the earnings.

3. Tools to use

Many 401(k) plans offer tools (online calculators, worksheets) for determining risk tolerance, but the best tool may be a competent financial planner. It may be worth hiring a planner to listen to your financial goals and evaluate your assets and earning ability to help you craft an allocation plan that will ensure a comfortable retirement.

FREE TOOL: Use our 401(K) calculator to estimate your savings over time.

4. Borrowing from your investments

Most 401(k) plans allow you to borrow up to 50% of your vested balance, but not more than $50,000. In most cases, you have to repay the money with interest within 5 years. The interest payments go into your account, but there are downsides.

The money you withdraw for the loan is no longer invested and, therefore, isn’t appreciating.

Also, the original contributions to the account were made with pretax dollars, but the loan payments will be made with after-tax dollars.

5. Leaving the company

Unless your company has an outstanding 401(k) plan, you should consider taking the account with you if you leave the company. If you’re going to another company, you may be able to roll it over into the new company’s plan. If not, you can roll your 401(k) into an IRA at a brokerage.

This gives you more control over your account and, in most cases, you’ll have much better investment options at a brokerage.

Just make sure you follow the proper procedures. The plan sponsor or the human resources department will assist you in transferring the money. You don’t want to accidentally cash out your retirement plan and get stuck paying taxes and penalties for early withdrawal.