Maternity leave

I'm starting my sophomore year in high school At the end of August I'm due October 16th when would be the right time to leave for maternity leave? A week or 2 before? Or a few days before my due date?