For many years, surnames were passed down by mothers. Today, though, most children in China take their father's last name, as do those in much of the world. Last names didn't come to Europe until later. They can be traced to the Middle Ages.
Who created last names?
Evidence indicates that surnames were first adopted among the feudal nobility and gentry, and slowly spread to other parts of society. Some of the early Norman nobility who arrived in England during the Norman conquest differentiated themselves by affixing 'de' (of) before the name of their village in France.
When did humans start using last names?
Family names came into use in the later Middle Ages (beginning roughly in the 11th century); the process was completed by the end of the 16th century.