Status, if you're a medieval Tuscan. As late as the catasto (tax records) of 1427, one historian estimates that only a third of the families listed (and those were just the property-owners) had surnames. Another historian, speaking of the same records, states that only about 16% of the surnames listed were "stable," i.e. consistent among generations and not still in flux. My research takes me back 100-200 years earlier than that, when surnames were even rarer. Men were more usually identified by adding their father's name (and, if necessary to avoid confusion, their grandfather's), like this: Giovanni di Ugo di Neri. If a man's father was deceased, he would be Giovanni del fu Ugo (absolute past tense: Ugo's finished and done). A woman was identified first by association with her father, and then, once married, with her husband.
It is fascinating to watch surnames emerge during a period of several hundred years, and to try to trace their derivation. Quite a lot of Florentine surnames were taken from the given name of an ancestor, often the ancestor considered to be the founder of the lineage. Thus, the Donati were descended from a Donato, the Gondi from a Gondo, and the Baldovinetti from a Baldovinetto.
Often the ancestor chosen by later generations to provide the family name was distinguished in some way: the Pazzi took their name from Pazzo di Ranieri, the first to enter Jerusalem in the first Crusade (1088); the Anselmi took theirs from Anselmo Fighineldi, who was knighted by Charlemagne (and who appears to have had a different surname of his own); and the Pandolfini from a notary named Pandolfino. The Pucci had a thirteenth century ancestor, Puccio di Benintendi, who was a cabinetmaker, but it appears that the name didn't stick as a surname until the more distinguished Puccio di Antonio, who served Florence as gonfaloniere di giustizia sometime later.
A family name could be derived from a nickname (the Canacci, from Lapo di Dino, known as Canaccio). It could stem from a profession or office, as the Visdomini, descended from one Davizo who had served as vicedominus, or episcopal caretaker, from 1009-1054. (An interesting sideline about this family is that Davizo's nephew Davizino married a woman called Tosa, and a future branch of the family adopted her name as their family name and called themselves the della Tosa, or the Tosinghi.)
The Pecori family took its name from Dino il Pecora (Dino "the Sheep"), the "Big Butcher" of Dante's day, a man prominent in the Butcher's Guild who was active in Florentine politics (and seems to have annoyed most of the contemporary chroniclers, who describe him in some unsavory ways).
A name could also be taken from a place: Buondelmonte dei Buondelmonti, the knight whose turbulent marital situation resulted in the split between the Guelfs and the Ghibellines in the early 13th century (and in my first book), came from a family which took its name from its castle at Montebuoni.
The Buondelmonte device, sketched on a wall
Incidentally, their coat of arms reflects all this emphasis on "good" and on "mountains": it consists of a stylized mountain, which looks like a gumdrop stacked on top of two other gumdrops, with a cross on top.
Even a product or commodity associated with a family could result in a name. The Rucellai were originally known as the Oricellari, because they imported the dyestuff orchil (oricello in Italian) from the Levant.
Women of the upper classes in medieval Florence were considered part of their fathers' lineages, not their husbands'. Women widowed during their childbearing years often rejoined their birth families after the death of their husbands and were given to new husbands, as their fathers (or brothers, if the father was no longer living) chose; sadly, they often had to leave their children behind, because the children, in their turn, were part of their own father's lineage, and therefore they stayed with their father's family. These kinds of marital politics had much to do with dowries and property, but that will be a post for another day.
Many women married into prominent families were identified only by given name and husband's name, but others, like Gemma Donati, who married "down" socially when she married Dante, are always referred to by their birth surnames. The Blessed Umiliana dei Cerchi was born into the wealthy Cerchi family and returned to them after her husband's death, and is always known by the surname she was born into. It appears that if a woman's birth name was the more prominent, she continued to be associated with it during her married life.
Thus, medieval Italian surnames can hint at lots of other things: affiliations, social status, whether one's parents were living or dead. They can be colorful - were the Infangati really covered with mud? were the Pazzi really mad? - and they can point to what a family takes most pride in. And, when the politics got really nasty, they could be changed to sever one branch's ties with another. I enjoy studying a time in which families were beginning to define themselves according to their own sense of history, and their own familial pride.