@netspencer – Originally the names just happened, as a way to separate the three different guys named Robert who all lived in the same village, and so on. Later, it became useful to append the father’s last name to the offspring to keep track of who was members of the rich branch of the family as opposed to the sheep-stealers.
There was no organized way of getting a last name. It was an organic process that was eventually codified in Britain about the time government started keeping formal track of people in the Domesday Book back in 1085.
Other countries and regions did it at different times. For example, China had hereditary family names dating back to the 4th century B.C., while Scandinavian countries developed mandatory family names as recently as the mid-1800s. Most European countries had hereditary last names somewhere between the 11th and 14th centuries, but some were as late as the late 1700’s.
Sometimes last names were indeed assigned, as in the last names assigned to German Jews to replace the Hebraic last names they had before. They were typically given last names in German that said where they lived or what they did for a living. However, the last name that a family got was affected by how much they could afford to pay. If you paid more you got a last name that referred to wealth or something nice, such as a rose. If you couldn’t pay very much you might get a last name that some clerk just made up out of nonsense syllables or that meant something common, like Eisen (iron).
And sometimes a person’s last name is a link to their parent of the same sex, as in Iceland, where males have the last name of dad’s first name + son, and females mom’s first name + dotter.