You have to give 10 weeks notice, like sherwils said, but if you thought you'd work til say 36 weeks but can't you can take it before then, it's just you can't keep working after you've said you want to take maternity leave.