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.
Like any government program, it is a confusing mess with numerous pitfalls and tricky decisions.Tom's Retirement Info / [email protected]