Despite me telling my line managers really early on, I needed my MatB1 form to officially hand in my notice, and I didn't/couldn't get that until about 20 weeks. They also couldn't advertise for my mat cover until they'd received my form. But 15th week before EDD sounds right for the legal notice.
Last time I finished up 4 weeks before and I'm doing the same again. My mum said it was the last time I'd be on my own/ have time to myself, and to enjoy it! It took me a good week to unwind from work then I enjoyed relaxing, reading books, cooking etc. I went into labour on my due date. This time around there is also the (slim) chance that baby might have to come early (I'm having growth scans) so again, I don't want to leave it too late.
I also knew a few people whose babies arrived early - I didn't want to be like them and finish work and have very little time before baby arrived!
Someone else on mumsnet once said you'll notice the time you have off before more than the extra week or two at the end of your leave (with the baby). I think that's probably true.
It's up to you though! But it is nice to have some time to unwind
let your boss or HR department know when you intend on taking it, once you have your matB1 form at around 21 weeks you can then officially book the time off. Think about it now, worry about it when the paperwork is in your hand lol