Retirement is a joyous milestone in life, and many workers are counting the days until they can leave their jobs and start enjoying a life of leisure.

However, retirement can also be a stressful time if you're not fully prepared for it -- especially when it comes to healthcare costs. The average worker currently in their 40s may spend roughly $335,000 on healthcare expenses in retirement, according to a study from Urban Institute, and those who live into their 90s can expect to spend even more -- approximately $500,000.

Some workers may not worry about these expenses, thinking Medicare has them covered for any healthcare costs that may come their way. But Medicare doesn't cover everything, and there are several crucial aspects of Medicare that the vast majority of workers don't understand.

Bottles of prescription medication on a shelf in a cabinet

Image source: Getty Images.

1. Does Medicare cover long-term care?

A whopping 90% of workers age 50 and older incorrectly believe Medicare will cover long-term care costs in retirement, a survey from Nationwide found.

While Medicare will usually cover short stays in a skilled nursing facility (as long as the care is considered medically necessary), it won't cover custodial care. Custodial care includes stays in a nursing home or assisted living facility, and it generally includes care such as helping residents get dressed, feed or bathe themselves, and perform household chores.

Approximately 70% of retirees will need long-term care eventually, research from the U.S. Department of Health and Human Services found, and those who need it use these types of services for an average of three years. Long-term care isn't cheap, either; the average semiprivate room in a nursing home will cost you around $6,800 per month. Over three years, that's nearly a quarter of a million dollars in long-term care costs alone.

Because these costs can take such a big bite out of your retirement savings (and you won't receive help from Medicare), it's important to start preparing for them early. Build the costs of long-term care into your retirement plan, or consider enrolling in long-term care insurance. If you opt for insurance, be forewarned that premiums are hefty (the average 55-year-old couple pays around $2,500 per year). But compared to a $250,000 long-term care bill, insurance might be worth the steep price.

2. Can you switch plans once you enroll in Medicare?

When survey participants were asked this question, 94% answered incorrectly, believing you cannot switch plans once you enroll. In reality, even after you enroll in a Medicare plan, you have two opportunities to change your plan each year.

There are two Medicare open enrollment periods every year, each with different opportunities to adjust your plan. One period runs from Oct. 15 to Dec. 7, and during this time you can switch from Original Medicare to a Medicare Advantage plan (or vice versa), switch from one Advantage plan to another, add prescription drug coverage to your Advantage plan, enroll in Part D prescription drug coverage, switch prescription drug plans, or drop prescription drug coverage altogether.

If you miss that window, there's another open enrollment period from Jan. 1 through March 31 when you can also make changes. However, during this period your options are more limited. For example, you can switch from one Advantage plan to another, but you can't switch from Original Medicare to an Advantage plan. You do, however, have the option to switch from an Advantage plan back to Original Medicare.

It's important to consider all your options when open enrollment comes around, because you might get a better deal by switching plans. If you think you're stuck with the same plan for the rest of your life, you might be spending more than you need to be.

3. Can you enroll in Medicare at any time?

Approximately 89% of survey respondents incorrectly believe you can enroll in Medicare at any time. In reality, once you become eligible, you'll have to enroll during one of the designated periods.

You become eligible to enroll in Medicare at age 65, so your enrollment window begins three months before the month you turn 65 and ends three months after that month. So there's a seven-month window surrounding your 65th birthday when you're able to enroll. If you miss this initial enrollment window, you'll need to wait until one of the other open enrollment periods to sign up, and you may also have to pay a penalty for not enrolling on time.

Under special circumstances you may be able to enroll during a special enrollment period. For example, if you continue working past your 65th birthday and are covered under your employer's insurance plan, you don't have to enroll in Medicare during your initial enrollment period; you can wait until you leave your job (and lose your insurance).

Understanding when you're allowed to enroll in Medicare coverage is crucial, because if you miss your window, you risk missing out on coverage. If you're currently using prescription drugs, losing insurance could force you to pay for that medication out of pocket -- which could cost you hundreds or even thousands of dollars.

Medicare can be confusing, and health insurance isn't the most exciting topic to think about as you're planning for retirement. However, not understanding how Medicare works can be costly. Before you retire, think about how you'll cover healthcare costs, and make sure you know how and when to enroll in Medicare. By doing so, you'll ensure your retirement savings go as far as possible.