I have been in this same situation before (without the child), and I stayed for 7 years. I knew about 3 years into the relationship that he was not "the one" that I wanted to be with for the rest of my life. I was not happy, and it bled into our relationship, and caused the ultimate deterioriation of the relationship itself. People looking from the outside thought we were perfect and we had the perfect relationship and we were happy... But that was a total front. Deep down we were miserable by the time it came close to the end. There was nothing that could have been done to save that relationship once I realized that he was not the one I wanted to marry and be with forever. We could have gotten married and had a life together, but it would not have been a life based on being in love or on romance or passion or anything that loving relationships should have in them.
Some said that I wasn't happy because of something wrong with ME. That I had issues to deal with and that me not being happy with myself was one reason that my relationship was breaking down. But it was not all my fault. It wasn't all about me and my happiness with myself as to whether or not I was going to be happy with him. I tried desperately to fix whatever was "wrong" with me on the inside - I started doing things I enjoyed, I went back to college, I found a new job, I started spending time with my family, I did some spiritual soul searching, I started reading. I did many things to change who I was, and in the end, I was changed - he was the same - and our relationship was still not going to work out, because the bottom line was I knew deep in my heart and soul that he was not the one at that moment in time that I wanted to be with forever.
Breaking up with him was the hardest thing that I have ever done in my life and it spiraled me into a guilt-ridden depression that took me over a year to get out of. I hated myself for hurting him and for breaking up the life that seemed so wonderful to outsiders. I wondered if I had made a mistake. I regretted the decision for a while. It was hard. Extremely hard.
What I regretted most about it was that I knew 3 years in that he was not the one and I dragged it out another 4 years and then I felt totally responsible for wasting 7 years of his life, because I could have left at any time. I knew for years that he was not the one.
It has been 2 years since then. We are the best of friends now and talk regularly. We are not getting back together and there is no hope of us ever getting married, but he will always be one of my closest friends because of the time we spent together, and we are both very happy with that. We date other people, and don't have a problem discussing it. We are "just" friends. We are happier now than we ever were in the 7 years we were together and we get along much better too. It has proven that my gut was right all those years ago.
Nobody can tell you what to do because only you know what your gut feeling on the situation is. No matter what you do, you are going to be losing something. If you stay then you will always wonder if you reached your fullest potential or if you missed out on meeting your "one". If you go, then you may feel guilty later in life. Relationships are indeed hard, but they should not be forced to work if they are simply not meant to be. And they definitely should not be forced just because people say that they are hard work and that you leaving is showing that you have no perserverance or that you're chasing a dream of some form of happiness that is not realistic. Just because you love someone doesn't mean that you are meant to be with them forever, and sometimes you have to go with your gut.
I would suggest that before you do anything dramatic that you discuss this with your boyfriend and see what his feelings are. For all you know, his gut may be telling him the same thing.