I'm not sure why people are talking about marriage when your question was about names 🙄
Re: the name, personally there's no way in hell I'd not give my child my name. I'd agree to my partner having his name in there too if it was important to him, but I'd probably call my child Firstname Mylastname in everyday life even if both surnames appear on the birth certificate.
But you need to do what feels right for you. My SIL gave her kids my brother's last name, although they're not married yet. She didn't give them her last name. In her place I'd have made a different decision, especially because they're a multicultural family and I think it'd be nice for the kids to also have a last name from her country. But if this works for her this is what matters.
Just bear in mind when you make your decision how you'd feel about it if you ever split up with your partner. Also consider whether you'd change your name if you got married (personally I wouldn't).
Re: the marriage, since it's come up, I think you should consider what would happen if you split up with your partner, and consider different scenarios (what if he is a hands on dad, what if he isn't and goes NC, etc). Make sure you and your child will be okay either way. Whether or not marriage works for you in that context is for you to decide.
Personally, one look at how painful and drawn-out divorces can be would put me off getting married massively. On the other hand I do understand that people who are vulnerable may find protection in marriage. But the short and long of it is that only you know your circumstances and what works for you. Just consider all the worst-case scenarios before making your decision one way or another.
Personally I'm secure financially with a very stable job. I don't plan on ever getting married.