Surnames have a very different history in every part of the world, and although surnames are common practice now, that wasn't always the case. The rules began to change in England around 1509 when Henry VIII, King of England, created a law stating that all marital births must be recorded with the father's surname. However, many Scottish and Welsh people didn't begin using surnames until at least the 17th century. 
Ireland was the first European country to use surnames, and according to the Annals, history of the Roman Empire from the years AD 14-68, Ó Cleirigh is the first surname recorded in the year 916.
In Ancient Greece surnames usually included where a person was from. Patronymics were also popular in Ancient Greece. For example, Alexander the Great was commonly called Heracleides because he was thought to be a descendant of Heracles, a hero in Greek mythology.
Patronymic surnames arose out of the vernacular and religious given name traditions.
The vernacular or regional naming tradition is the oldest and most pervasive type of patronymic surname. According to this custom, names were originally composed of vocabulary elements from the local language. Vernacular names that were derived from ancient Germanic personal names have cognates in most European languages. For example, the court of Charlemagne (742-814) was Christian and Latin-speaking, but the Frankish dialect of Old High German was commonly used for personal names. Vernacular names were also widespread in Germany. As a result, many typical English and French names are of Germanic origin and have cognates in other European languages.
In the religious naming tradition, which was developed later than the vernacular tradition, surnames were bestowed in honor of religious figures or church officials. In Europe, the Christian Church was one of the most powerful influences on the formation of given names. Personal names derived from the names of saints, apostles, biblical figures, and missionaries are widespread in most European countries. In the Middle Ages, they became increasingly popular because people believed that the souls of the deceased continued to be involved in this world. They named their children after saints in the hope that the child would be blessed or protected by the saint.
In Old English, patronyms were formed by adding a variety of suffixes to personal names, which changed over time and from place to place. For example, after the Norman Conquest, sunu and sune, which meant son, were the most common patronymic suffixes.
In the 12th and 13th centuries, most common patronymic names included the word filius, which meant son. Typically the name was structured:
[Personal name] filius [Surname]. For example, Willemus filius Raunaldi.
By the 14th century, the suffix son had replaced these earlier versions. Surnames that were formed with filius or son were more common in the north of England and it was here that the number of individuals without surnames was greatest at this time.
Often the names of the parents were included, as well as a baptism date. In this format you see et uxor ejus, meaning " and his wife." This format was structured:
[Personal name] filius [Father's name] [Surname] et [Mother's name] uxor ejus baptizatus/baptizata fuit. Anno pro. 1712.
Baptizatus was used for males and baptizata was for females. Anno pro translates to "in the year."
Another fairly common patronym suffix was the use of atte. In this case, it was used to denote the location of a person. A name like this was structured:
[Personal name] atte [Surname]. For example, Willemus atte Raunaldi.
In this case, it would be Willemus at Raunaldi, where Raunaldi was a hamlet or village.
Richard Hannebrothir, Ameria Ibbotdoghter, Wluin Brune Stepsune, and Emma Rogerdaughter, are also all examples of patronymic surnames.
Metronymics, names based on the mother's name, were similar in form, however they were far less common. Examples of metronymic surnames would be Siwardus Leuerunessone and Edric Modheuesune. Metronyms are often recognizable by the -e on the end of the name, which typically means that it is a feminine name.
Local names, which are also referred to as toponymic surnames, were given to a person who resided near a physical feature such as a hill, stream, church, or type of tree. They were also sometimes used to denote a person's nationality.
The most popular examples of these types of names would be English, Scott, Breton, Fleming, Angwin, Loring, and Poidevin. Later we even see surnames, such as Irish, Welsh, Wallas, Gall, Norman, Cornish, Cornwallis, Devenish, Surridge, Sotheran, Western, and Westridge. At the start of the 14th century we start finding toponymic names with an -er on the end such as, Bridger, in the areas of Sussex, Kent, Surrey, Essex, and Hampshire.
Habitation names form the other broad category of surnames that were derived from place-names. They were derived from pre-existing names for towns, villages, parishes, or farmsteads. Other local names are derived from the names of houses, manors, estates, regions, and entire counties. As a general rule, the greater the distance between an individual and their homeland, the larger the territory they were named after. For example, a person who only moved to another parish would be known by the name of their original village, while people who migrated to a different country were often known by the name of a region or country from which they came.
English local names were originally preceded by a preposition, such as de, at, atte, by, in. After the Norman Conquest, the usual preposition was de, which was used in both English and French place-names. In French surnames beginning with a vowel, we see the preposition de as d', due to the French rule of dropping the vowel off the end of a preposition if the following word begins with a vowel. For example, de Ash would become D'ash, which eventually became Dash. By the end of the 14th century, prepositions were frequently assimilated or dropped from the surname completely. The earliest example of this was in 1318, however the timing varies depending on location.
It is recorded that there are 163 local surnames in the Domesday Book without a preposition.
Occupational names that were derived from the common trades of the medieval era transcended European cultural and linguistic boundaries. This phenomenon is demonstrated by names such as the German name Schumaker, which means a maker of shoes, the Ashkenazic Jewish name Zimmerman, which means carpenter, the Polish and Jewish name Stolarski, which means joiner, the Dutch name Schuyler, which means teacher and the Italian name Calderone, which means seller of spices.
Similarly, surnames of office, which include military, judicial, papal and other positions of authority, are widespread throughout Europe. Those who were involved in the military, or feudal armies, were given names such as the English surname Archer, the French name Chevalier and the German name Jeger, which means hunter. Names that were derived from judicial and papal titles, such as Bailiffe, Squire, and Abbott, are still commonly seen with the same surname spelling today.
Occupational names were frequently derived from the principal object associated with the activity of the original bearer, such as tools or products. These types of occupational surnames are called metonymic surnames.
The most common suffixes for occupational names are maker, herd, hewer, smith, er, ing, and man.
A large number of our modern surnames were at one point considered to be nicknames. Nicknames typically referred either directly or indirectly to a characteristic of the original bearer of the name. They can describe the bearer's favored style of clothing, appearance, habits, or character.
The surnames Head, Foot, Broadhead, Redhead, Good, Moody, Sharp, Proud, and Wise are all examples of surnames that likely derived from nicknames.
Often nicknames described attributes that were traditionally assigned to animals. In the pre-Christian era, many pagan gods and demi-gods were believed to be a mixture of animals and humans, such as the Greek god Pan, who was the god of the wild, shepherds, flocks and herds and was represented as a man with the legs, horns, and ears of a goat. In the Middle Ages, anthropomorphic ideas, which attributed human qualities and form to gods or animals, were held about the characters of other living creatures. They were based on the creature's habits. Moreover, these associations were reflected in folk tales, mythology, and legends which portrayed animals behaving as humans. A modern example of anthropomorphism is the cartoon character Bugs Bunny, who is a rabbit with human characteristics.
Nickname surnames were frequently the result of a spontaneous reaction to a particular occasion or event.
Diminutive is an expression relating to smallness in size or endearment, of the name.
The most common diminutive suffixes are ot, et, un, in, and el. Double diminutives are also formed from these suffixes, such as Hamelin, Roblett, Adnett, or Turkentine. Names ending in -cock and -kin became used more frequently in the mid-13th century and by the 14th century they were extremely common.
Polygenetic surnames are developed in a number of different locations and adopted by various families independently. Most surnames can fall into this category, but the most common are local surnames that refer to a geographic feature like a hill, pond, valley and patronymic surnames that refer to Celtic Saints, biblical people, and the like.