I left at 30 weeks. Used 5 weeks of annual leave before maternity leave kicked in.
I'm a nurse & couldn't have worked any longer than that as I was on my feet 8.5 hours per day. I LOVED having 10 weeks at home, plus my DH took annual leave too so we some time together before DS was born (which was 3 days after EDD).