Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

For anyone who plans to keep working after they turn 65—and that’s a growing number of people—planning for Medicare can be complicated. Last week’s column discussed the dizzying array of enrollment periods and other sign-up timetables for people who turn 65 and sign up for Medicare. In this column, I’ll explain the tricky transition from employer insurance to Medicare.

Roughly a third of Americans aged 65 to 69 remain in the work force—a rate 50% higher than only a decade ago. So the adage that everyone must get Medicare when they turn 65 is not true for more and more older Americans.

If you continue to work and have employer group health insurance, you probably do not need to sign up for Medicare. Also, if you lose employer coverage and do get Medicare, and then get a new job with employer health coverage, you usually will not need to keep Medicare. This often surprises people who think they must remain covered by Medicare for the rest of their lives once they get it the first time.

That said, there are exceptions and caveats to that general rule. So to avoid potential stumbling blocks, consider these three key guidelines:

Small business workers may need to sign up. If you're about to turn 65, and you work for an employer with fewer than 20 workers, yes, you probably need to sign up. In these small-employer plans, Medicare becomes what’s called the primary payer of covered insurance claims for employees 65 and older. Your employer plan is the secondary payer.

If you fail to enroll, Medicare can deny you primary health insurance for many months. And when you finally do sign up, you often face premium surcharges that will last the rest of your life, which could cost you thousands of dollars. As a I mentioned last week, the initial enrollment window for Medicare lasts for seven months—three months before turning 65, the month you turn 65, and three months after your birthday month.

Check your employer's Part D plan. For people working for larger employers, you don't face this enrollment rule. However—and there are almost always howevers when it comes to Medicare—there's a technical requirement for avoiding Medicare coverage, which could be a potential stumbling block to coverage.

Medicare requires that a person’s employer drug coverage be “creditable”—meaning that it must be at least as good as a Medicare Part D prescription drug plan. If that's not the case, the person would need to sign up for a Part D plan. If you don’t, you will face lifetime premium surcharges for failing to do so on a timely basis.

How likely is it that your drug coverage would not be credible? Honestly, I have never gotten a reader question or spoken to anyone whose employer drug coverage was found to fall short. But if it did, the employee likely would not know until it was too late. Since it is a rule, employees approaching 65 should get confirmation from their human resource manager that your drug coverage passes this test.

Consider signing up for Part A anyway. Even if you do not need to enroll for Medicare at age 65, you should probably sign up for Medicare Part A, which covers hospital expenses and short-term stays in nursing homes. Part A premiums are waived for people whose work records qualify them for Social Security. Normally, this requires working 40 quarters in jobs where Social Security payroll taxes are paid.

Medicare Part A is a secondary payer in this scenario, which means it can help out with expenses not covered by employer group insurance. It does carry a steep-sounding deductible of $1,260 for each covered stay. But the cost of even brief hospital stays easily can soar to many multiples of this deductible, making Part A a nice benefit to have.

Signing up for Part A does have a big downside. By doing so, you will no longer be eligible to contribute to a tax-advantaged health savings account (HSA). If you have an HSA now, you will need to compare the potential benefit of Part A coverage with the loss of your ability to contribute to the account. If you choose to give up contributing to your HSA, however, you will still keep any accumulated funds for as long as you wish. And that money won't be taxed if you spend it on qualified medical expenses.

Philip Moeller is an expert on retirement, aging, and health. He is co-author of The New York Times bestseller, “Get What’s Yours: The Secrets to Maxing Out Your Social Security,” and is working on a companion book about Medicare. Reach him at moeller.philip@gmail.com or @PhilMoeller on Twitter.

Read next: This Is the Biggest Mistake People Make When Signing Up for Medicare