Maternity leave

How many months or weeks you should start taking maternity leave before you deliver the baby?