You can apply anytime during the Initial Enrollment Period (IEP). Your Initial Enrollment Period is a 7-month window around your 65th birthday. It covers your birth month, plus the 3 months before and the 3 months after.
After you enroll in Original Medicare and during your IEP, you can add a Medicare Advantage (Part C) plan or a Medicare prescription drug (Part D) plan.