As already highlighted in comments, the use of 'western naming system' is problematic so it is only possible to produce a fairly generalized answer for most of western Europe (and, by extension and to greatly varying degrees, areas subjected to European colonization - primarily French and British).
In The Means of Naming: A social and cultural history of personal naming in western Europe (1998), the author Stephen Wilson writes in his conclusion on the two millennia of personal naming he surveys:
First, naming practices go through a limited number of long-term
phases. The Roman tria nomina develop in the Republican period and
survive into the Empire to be replaced for most classes by a Latin
single-name system. With the fall of Rome, this gives way—but not at
once—to a Germanic singlename system, in which names are composed of
specific elements and in which originally each person has a distinct
name. Only in the central medieval period is a second name introduced,
which becomes a fixed family name from around the fourteenth century,
though this process is delayed for much of the peasantry until later.
Once fixed from the medieval period, second names survive unchanged
down to the present.
A key (but far from only) reason for the spread of the practice of adopting a second name in the middle ages was the increasing use of fewer and fewer names. This is well illustrated by this 1230 writ from Henry III of England to the Sheriff of Essex concerning the confusion over who was responsible for a loan of 60 shillings from the exchequer. Was it
from Richard son of William in the time of lord John the king our
father, was made to Richard son of William of Stapleford or to Richard
father of Robert of Tilbury; and if the same Richard, the father of
Robert...was called Richard son of William or Richard son of Robert?
Cited by S. Wilson, The Means of Naming
Thus, 'qualifiers' were introduced and, according to grammatical convention, this meant the use of copulatives (connecting words) such as of (de) and the (le or l'), followed by two of the most common 'qualifiers', place and occupation.
This took quite some to become standardized, though, and it should not be assumed that the son would have the same second name as the father, or even that a man would have only one way of styling himself. Wilson cites many examples, among which are:
Filippo Brunelleschi (1377–1446), the Florentine architect, was the
son of Brunellesco di Lippo Lapi.
Ricardus filius Fyn (c.1160, Yorkshire) was later called Ricardus Fyn
Peros Moreuz le Basters, Peron Morel, or Peron Baster (1290)
Also, the practice of adopting a second name developed later among the peasantry:
In most areas, the second name began among the nobility and percolated
downwards or outwards later. It penetrated the laity before the clergy
and was used by men before women. In other words, it was associated
with public life and certain functions within public life....Once the process began, it spread
geographically and socially because the underlying reasons repeated themselves
but also through emulation.
The practice of listing names alphabetically by second name developed much later:
An indicator of the continuing importance of the first name as the
name is found in early name listings. Febvre noted that in
sixteenth-century catalogues of authors, their names “are cited in
alphabetical order not of family but of first names: all the Jacobus,
then all the Johannes, and the Paulus, and the Petrus”.
...in the southern Netherlands “at the end of the seventeenth century,
the clerks of law courts and lay notaries still drew up lists of their
protocols in alphabetical order of first names”....Only with trade directories of the eighteenth and nineteenth
centuries and bureaucratic documentation from the same period does listing
by second name become predominant and then universal.
For Northern India, there does not appear to have been any widespread western influence before the colonial period.
In many parts of India, there originally was no concept of using
surnames as understood in the Western world. Under British colonial
rule, however, Indians were expected to follow a naming system that
corresponded with the British naming convention. People in different
regions of India responded differently to the requirement. Indians in
the northern, western, and eastern regions seemed to adapt more easily
to the new convention.
Even today, many Indians don't have a surname but it's a confusing picture overall. More details can be found here and here.
As previously noted, conventions vary even within western Europe so you might want to look at these two cases: