Your initial enrollment period for Medicare runs seven months: the three months before the month you turn 65, your birthday month, and the three months after. Sign up in the first three and coverage starts the first of your birthday month. Sign up after, and it starts later.
Part A, hospital coverage, is premium-free for most people because you paid for it through payroll taxes. Almost everyone takes it at 65. Part B, which covers doctors and outpatient care, has a monthly premium, and that's where the decision lives.
If you're still working at 65 and covered by an employer plan at a company with 20 or more employees, you can delay Part B without a penalty. When you retire, a special enrollment period gives you eight months to sign up. Under 20 employees, Medicare usually becomes primary at 65 and delaying leaves you exposed, so check with the plan administrator before you assume anything.
Miss the window without qualifying coverage and the Part B penalty is 10% of the premium for every full 12-month period you went without. That isn't a one-time fee. It stays on the premium as long as you have Part B.
COBRA and retiree coverage don't count as active employer coverage for this. People retire, take 18 months of COBRA, and think they're fine. They aren't, and the penalty clock is running the whole time.
One more piece that catches higher earners. Part B and Part D premiums are means-tested through IRMAA, and the income they use is your modified adjusted gross income from two years back. So a one-time event at 63, selling a rental or converting a large IRA balance, can raise your Medicare premiums at 65. It's assessed year by year and it comes back down when the income does.
Part D, the drug coverage, has its own late penalty on the same logic, roughly 1% of the national base premium for each month you went without creditable coverage. If you take no prescriptions at 65, enrolling in an inexpensive Part D plan anyway usually costs less over time than carrying a penalty for the rest of your life.