Might be easier to just focus on England with this question.
People keep saying that surnames were given based on your occupation or other factors. However it's always talked about as some vague point of time in the past, I'm wondering if there was a more specific time and places where this was done?
Like Smith if you were a blacksmith, or Forrest if you worked in a Forest etc. I assume it's some time before the industrial revolution.
Was there a point in history where half the people had surnames, and the other half didn't? How was it that by the beginning of the 20th century everyone conveniently had surnames?
We can assume that onomastics based on the father's or mother's trade or attributes might have been around for a long time. Greek historian and general Thucydides (460 ca. - 404 BC) was know as "Thucydides, son of Oloros from the demos ("regional unit", "village") of Halimous". Republican Roman politicians and reformist brothers Gaius and Tiberius Gracchus, in office for the years 133-121 BC, were called "Gaius/Tiberius Sempronius Gracchus" whereas "Sempronius" was most likely their father's name and Gracchus was what we can understand as a family name.
The more widespread usage of the formula "William Tyler" can be linked with the centuries of the Middle Ages, along with two important factors. Firstly, the imperial administration which kept track of the name and family of its citiziens, in order to distinguish their juridical status and their relative census virtually crumbled in its entirety around the VI century AD, making it impossible to list the name structure until then in use. Secondly, the migration and movement of Germanic populations, who had different naming conventions and cultural traits "shuffled the cards" so to speak, bringing another set of customs among the landowning and aristocratic classes. The line of princes of Salerno, in southern Italy, were known as "Guaimar I/II/ III/IV of Salerno", without a family name attached as far as we can tell.
There is the possibility that such tendency has always been in place, since it was possible to distinguish members of a distinguished family from what then became their last name or family name (i.e. Megacles of the Alcmeonidae was the archon eponymous of Athens in ca. 632 BC who fought off the attempt of Cylon to make himself tyrant of Athens. The Alcmeonidae were an aristocratic family named after a possible ancestor named Alcmeon). Similarly, the family of dukes of the medieval city of Sessa, in southern Italy, were called Marzano, a name they took after the name their family holdings had (survived in nowdays town of Marzano Appio).
Notable Italian writers and poets of the 1300s, Dante Alighieri and Giovanni Boccaccio were probably called "Durante, son of Alighiero, son of Bellincione" later called by the shortened version of his name, "Dante of the Alighieri" intending the whole family at some point after his birth; and "Giovanni son of Boccaccio of Chellino", later morphed into "Giovanni Boccaccio". Even more important people like kings obtained their family names by the places or titles their ancestors possessed. Milanese ducal families Visconti (XIII-XIV cent.) and Sforza (XV-XVI) had their names by the rank they possessed when obtained the duchy (in the first case, "Visconti" is the Italian equivalent of "viscount" in English"), or due to the nickname their forefather possessed (Muzio Attendolo was count of Cotignola and a condottiere [mercenary captain] who took possession of the duchy of Milan and was allegedly nicknamed Sforza - meaning "he who pushes; makes an effort" - due to his impulsive and/or violent nature or for his perfomances in bed).
Proper surnames, whenever their origin might have been, appear to stabilize around the Modern Age, perhaps from the late 1500s into the early 1600s, at least in Italy and England as far as I have been able to understand.
But please, take this explanation with a pinch of salt because it's very difficult to draw a clear line to distinguish said tendencies which are quite complex and muddy.