The short answer: Three Months.
A little explanation: Medicare enrollment begins 3 months before your 65th birthday and continues to the end of the 3rd month after your birth month. If you aren’t already enrolled and receiving Social Security, you will need to sign up during this period. If you are receiving Social Security checks, you will be automatically enrolled upon turning 65. If you live in Puerto Rico, you will only receive part A automatically and will have to sign up for Part B yourself if you want that benefit. If you live elsewhere in the United States and you are receiving Social Security, you will be automatically enrolled in Part A and Part B.
Want more information? Here is a government reference to get you started with Medicare.
And here is more information about the sign-up periods for Part A and Part B.
If you have further questions, call Your Insurance Gal Agency at 360-771-1155
and talk to a local agent who is happy to help walk you through the entire enrollment process.