In my opinion, after marriage. And during the time you're married, be sure you are going to stay with that person a long time because divorces can cause mental health issues towards the child. And if your loved one is abusive, an alcoholic, etc. then you should get out that relationship immediately before having children. Therefore, your children will have a happy, healthy, life.