they booked me in immediately after my 12 weeks scan when I saw the consultant, it was already in my notes that i was wanting to have an elective section. Think it depends on your area though as to when it gets booked, some people don't find out when it is until a couple of weeks before!
here they section you at 39 weeks as a standard for an elective section although I'm guessing that will be different if there is a medical need to do it earlier.