You have a 7 month window, centered on the month when you turn 65.
Medicare is handled by the SSA. You apply for Medicare on the SSA website, taking care to apply for Medicare only. Doing so is not hard, they have a clearly labeled checkbox in the application dialog to indicate this is what you want to do.
Tom's Retirement Info / email@example.com