Other examples include Game of Thrones, and I’m just curious if it was just as common in medieval, or even ancient history for people to refer to themselves in this manner
It was a very common occurrence already in Roman times and even in Greek antiquity because, simply put, people with surnames very few and belonging to a given social group or class.
If you take Caesar for example, his full name was Caius Iulius Caesar, where "Iulius" was his family name, stating that he belonged to the gens Iulia, family of Iulius (its founder) and that he descended from the Caesarian branch of the family.
A Roman of lesser condition or a freed slave, such as Livius Andronicus, would only be known for his first name and probably his father's name, or for his former master's name as was the case of Livius', being a Greek slave freed by a member of the gens Livia took his owner's family name while latinizing his own (Andronicus is a transposition of a Greek equivalent).
In ancient Greece, you would be known by your father's name and the name of the administrative unit you were born in (demoi in Athens). The Greek historian Thucydides was called "Thucydides, son of Olorus of the demos of Halimous". People born in wealthy aristocratic families would use pretty much the same naming structure but their patronimics would be istantly recognized as those of an important group.
In the Middle Ages, it goes pretty much the same way to the point that most of these forms of identification have survived and turned into nowdays surnames. The only exceptions would always have been royal or aristocratic families that could claim one uniform descendance. King John of England was born "John Plantagenet" just like Holy Roman Emperor Frederick II was known as "Frederick of Hohenstaufen" which on its own means "of the castle of Staufen".
Medieval Italian documents tell us that those without notable families usually were named up to the third generation of ancestors and mixed their place of origin as well. Poet and intellectual Dante Alighieri signed himself as "Durante de messer Alighiero de Bellincione da Firenze", "Durante son of ser Alighiero, son of ser Bellincione of Florence".
Another very common way of naming oneself and his family was by his trade. Common surnames like Smith, Tylor, Fletcher, Carpenter, Baker are all reminiscent of the father's profession or just the first member of the family of being named in that manner. Sports car manufacturer's surname Ferrari means "iron workers" in Italian.
Nicknames and adjectives of a family head would likely survive onwards. Italian examples I can quote, being my field of expertise, are those like "Ianniello", "Small/tiny John", "Capaccio", "Bad head/Stubborn" or "Longo", "Long/tall".
As a last note, certain surnames even those belonging to people of lower rank could start becoming surnames on their own over the generations. In fact, those I mentioned earlier started losing the particle "of, from, son of, the" and just being used as they were or being pluralized (i.e. Smith into Smiths). This happened much earlier with aristocratic families due to their reduced numbers and exclusive belonging - you couldn't mistake the Capets or Hautevilles that easily, and even if they intermarry they would add the new surname to their own like the king Charles of Anjou-Durazzo.