Millions of Americans have access to employer-sponsored retirement plans like 401(k)s. These tax-favored retirement accounts allow workers to save thousands of dollars each year, sometimes earning immediate tax savings as a result and setting themselves up over the long run for years of tax-deferred growth.

One of the best features of many employer-sponsored 401(k) plans is that they offer an employer match when employees make contributions to their retirement accounts. Those matching contributions essentially act as free money to increase the size of your retirement nest egg.

Yet even though the money that employers chip in on your behalf can add up to a lot by the end of your career, there's one thing that workers increasingly need to keep in mind when it comes to employer 401(k) matching -- the possibility of having to forfeit the money they've received from their company.

What you need to know about vesting

Each 401(k) that offers employer matching contributions also comes with what's known as a vesting schedule. Vesting refers to the point at which you've participated in the plan long enough for the money that your company deposited into your 401(k) account on your behalf is yours to keep.

Person shying away from two arms trying to grab a piggy bank.

Image source: Getty Images.

Remember, employers offer matching contributions to employees as more than just a way to boost overall worker benefits. Ideally, employers like to give incentives to workers to stay on board because high turnover rates among employees becomes costly and inefficient for the overall business.

Vesting can be a way to encourage workers not to leave the company. Although some 401(k) plans call for immediate vesting of any 401(k) employer matching contributions, most follow a schedule. And contributions only become vested after a certain period of time.

The two types of delayed vesting

Specifically, if an employer chooses not to offer immediate vesting, they can choose from a couple of alternatives. The first, known as cliff vesting, makes the entire amount of matching contributions yours to keep at a specific time.

Under federal law and Department of Labor regulations, a cliff vesting schedule requires that employee participants become fully vested when they have reached three years of service, as defined by the plan. That typically takes 36 months, although it can be slightly more or less, depending on how the plan defines a year of service and when the employee joins the company.

The other option for employers is to use graded vesting. Under this type of vesting, an employee doesn't become vested in matching contributions all at once. Instead, following the slowest permitted schedule, a worker must become vested in 20% of matching contributions after two years of service. Then, for every additional year of service, the vesting percentage rises by 20 percentage points. That works out to 40% after three years, 60% after four, 80% after five, and becoming fully vested after six years of service.

Employers always have the ability to have vesting schedules that give employees more of their money sooner than these schedules specify. However, slower vesting schedules aren't permitted.

What happens to unvested money?

If you leave your job before your employer matching contributions fully vest, then you have to forfeit the unvested portion back to your employer. Those funds can then be used to cover expenses of the 401(k) plan or to pay employer matches to other employees.

Also, keep in mind that you'll have to forfeit not only the unvested matching contributions, but also any income or gains that those contributions generated while in the account. So if your employer matched your $1,000 401(k) contribution dollar for dollar, and the $2,000 total grew to $3,000 when you quit before vesting, you wouldn't forfeit just the $1,000 in employer matching funds, but also the $500 in growth attributable to that money.

Under the right circumstances, it can make sense to leave a job, even if staying longer could get you vested more fully in your 401(k). However, before making a final decision, check to see exactly how much your choice could cost you.