This is the mother’s choice, since her being unmarried means she gets to decide.
When I had my son, I was not married yet. At the hospital, they labeled him with my last name. My husband and I filled out the necessary paperwork, where he claimed paternity and I consented to the paternity. We gave our son my now husbands last name, since we had every intention of getting married. I would have done it if we weren’t getting married though.
My SIL gave her daughter her last name, because she was grateful she had a little girl and not a boy, because the guy would have wanted to have more to do with the child. He’s still a crappy dad.
I must say, before I changed my last name to be the same as my son, it was a huge pain in the ass. I had to argue with people in offices that he indeed was my son, which was very frustrating. It made going to the pediatrican annoying, because I was the carrier of the insurance but we didn’t share the same last name so we constantly had issues.
It’s much easier now that we all have the same last name. (I actually have two last names, so I can go by both, which is cool)
Some states have very strict laws about paternity and claiming it at the hospital. It was easy peasy for us, but I’ve heard horror stories elsewhere.
Oh, and since we were unmarried, I had all the parental control of our son, which was frustrating at the hospital because I had just had a hard labor and they refused to get consent for anything from my then fiance. They didn’t need to be so strict.