Many people retire at or before age 65, and sign up for Medicare as soon as they're eligible. Medicare coverage begins at 65, and your initial enrollment window spans seven months, beginning three months prior to the month of your 65th birthday and ending three months after that month.

But if you're still working at age 65 and covered by a group health plan at work, you may not want to sign up for Medicare at that time. For one thing, you'll have to pay a premium for Part B, whereas your employer might fully cover your health insurance premiums. And you may be entitled to better coverage through your employer. For example, Medicare doesn't cover dental, hearing, or vision services, but you may be entitled to coverage for all of these when insured through an employer. Or you might want to sign up for just Medicare Part A, but be sure to check how this will affect you if you contribute to a health savings account.

Older man in business suit sitting in airport waiting area

IMAGE SOURCE: GETTY IMAGES.

Once you do retire after age 65, however, you must make sure to sign up for Medicare on time. Delaying enrollment could prove costly in more ways than one.

How Medicare special enrollment periods work

When you don't sign up for Medicare during the seven-month initial enrollment window described above, you risk a 10% penalty that's tacked onto your Part B premiums for every 12-month period you go without coverage upon being eligible. That's an expense that can eat into your income or retirement savings later in life.

However, if you're still working at age 65 and have access to a group health plan through a company that employs 20 people or more, you don't need to sign up for Medicare during your initial enrollment window. Instead, you'll get a special enrollment period to sign up.

That special enrollment period lasts for eight months and begins the month after your employment arrangement ends or the month after you stop getting group health coverage through your employer -- whichever comes first. If you sign up for Medicare during your special enrollment period, you won't face the aforementioned Part B penalty.

Keep in mind, however, that if you leave your job after age 65 and sign up for COBRA, which lets you continue with your existing health coverage for up to 18 months provided you're willing to pay for it, that's not considered group health coverage for Medicare enrollment purposes. In other words, if you separate from your employer in June and begin COBRA coverage in July, your special enrollment window for Medicare also begins in July.

Of course, much of the time, it's more cost-effective to sign up for Medicare than to pay for COBRA because with the latter, you're covering the cost of a health insurance premium your employer most likely subsidized. Furthermore, because you can only get coverage under COBRA for 18 months, it's not a long-term solution, anyway.

Know your deadlines

The last thing you want to do is make healthcare more expensive in retirement. If you don't sign up for Medicare at age 65 because you're still working and have health coverage at that time, take note of when your special enrollment period begins once you leave your employer or lose that coverage (keeping in mind that both may not happen simultaneously). That way, you can avoid signing up for Medicare late and facing costly penalties for life.