Returning to work is a personal decision that should be made with your family. It can be helpful to get input from colleagues and friends, who have been there before, but ultimately the decision is up to you. While becoming a parent is a life changing event, you are still you, and you know yourself best. Factors that you should consider when planning the length of your leave might include if you want to split your parental leave with a partner, your financial situation, child care availability, and where you are in your residency training.
While on parental leave you may decide that you need to shorten or lengthen your leave. Keep in mind, until you meet your child you will not know how easy it will be to return to work. Some babies are easy going and good sleepers, while some, though still adorable, are not. Be willing to change your plan based on the temperament of your child, because sleep is important to your function at work.
Any time taken off residency must be made up, which will prolong your training.