I'd say either before you start call (which depends on the program) or early in R-4 when you are on call the least. That way you will get the least negative response from your fellow residents for maternity of paternity leave and will have the most time to spend with the kiddo.
Earlier is better, shoot for the 1st year. Howewver, if do it later, you can make do as well. Other residents in your program will be compensated after your maternal leave by your chief residents -- they will get less call later and you will get more. Programs keep track of how many calls a resident gets over a year, and it all evens out in the end. Besides, you will not be able to take that much time off anyway as the ABR has rules about prolonged absences. You will only be able to take 6 weeks off -- basically your entire vacation period plus sick leave for that academic year.
Thanks for the information, I wasn't planning to take more than a week or two off - I have no idea how realistic that is! I was more concerned about spending time at home, helping out when I am not working.