Last name

Someone at my work was talking to me about when you have a baby and you aren't married the baby has to take the mothers last name?  Is this true? I do not want my baby to have my last name. I want the baby to have its fathers last name. Is this true? If so is there something the father can sign at the hospital to state he is the father? 
Thanks!