There are several ways to enroll in Medicare, whether you plan to retire or keep working: If you begin receiving Social Security retirement benefits between age 62 and up to 4 months before turning 65, you will be automatically enrolled in Medicare Part A and Part B when you turn 65.  If you apply for Social Security 3 months before you turn 65 or later, you can sign up for Medicare when you apply for Social Security.  The Initial Enrollment Period to sign up for Medicare begins 3 months before you turn 65 and ends 3 months after the month you turn 65 — a total of 7 months. You may have to pay a penalty if you miss your Initial Enrollment Period. If you are not ready to receive Social Security benefits at 65 because you are still working, you can apply online for Medicare only. Or you may be able to wait until you retire to sign up during a special enrollment period. Learn more about how Medicare works if you are employed past age 65. Read this important information explaining when to sign up for Medicare based on your situation. Sign up for Medicare