You can also answer for middle names if you feel so inclined.
This is rather difficult to answer as different cultural and ethnic groups will have seen the phenomena of surnames emerge at differing times in their history. The Irish have a deeper history with family names than you would see in English history. The Far East has an entirely different history regarding this sort of thing that in no way can compare to the west. I will stick with what I know the most about, which is British history.
Early family names emerge in England after William the Conqueror defeated the Anglo-Saxon King Harold Godwinson. William commissioned a survey of his newly conquered lands that led to what we now know as the Domesday Book. The vest early surnames were largely attached to wealthy nobility and identified where their family originated from (example: de Vere) Also surnames could be attached to various trades/occupations (Smith, Archer, Fletcher) They also can stem from nicknames (White, Black, Smallman, Armstrong, Sparrow) Surnames differ in spelling until the 19th century when modern Britain is truly born. http://www.bbc.co.uk/history/familyhistory/get_started/surnames_01.shtml
Depending on the culture, they've been around for a while.
They were not always inherited from one's father, but rather a way of describing the person or their profession. For example Smith was linked to metal smiths. Others are to show one's lineage. Depending on the culture others were used to show places of origin.
Fixed surnames, ones that do not change from generation to generation, stares taking on popularity in the 1800's.
hi! you'll find several previous responses in the FAQ (link on sidebar):