You have a 7-month window to apply for Social Security.
If your new to Medicare, the timeline would be 3-months before your 65th birth month and 3-months after your birth month to apply for a Medicare card. You cannot enroll in a Medicare policy unless you have a Medicare card with issue dates for Part A and Part B.
If you are going to continue working after your 65th birthday, and your employer has a creditable health and medication plan, then you can delay applying for Part B and delay getting your monthly Social security check until after you retire.
When you do decide to retire and leave your employers health plan, you will have a 2-month period to select and enroll in a Medicare health plan. It is best to contact me me at least 2-months before your retirement date.
Even if you are under 65-years of age and on disability, you can enroll in a Medicare Policy if you are past the 2-year mark. If you are on Social Security disability, you will automatically be enrolled in Medicare Part A and Part B prior to your 65th birth month.