Traditionally, if John Smith and Nancy Jones, who live in an English-speaking country, get married and have a child, he or she would end up with a name such as Chris Smith.
The matter of Spanish surnames might seem confusing at first, but that's mostly because it's different. Although there are numerous variations of how names are handled, just as there can be in English, the basic rule of Spanish names is fairly simple: In general, a person born into a Spanish-speaking family is given a first name followed by two surnames, the first being the father's family name (or, more precisely, the surname he gained from his father) followed by the mother's family name (or, again more precisely, the surname she gained from her father).
Take as an example the name of Teresa García Ramírez. Teresa is the name given at birth, García is the family name from her father, and Ramírez is the family name from her mother.
If Teresa García Ramírez marries Elí Arroyo López, she doesn't change her name. But it would be extremely common for her to add "de Arroyo" (literally, "of Arroyo"), making her name Teresa García Ramírez de Arroyo.
Sometimes, the two surnames can be separated by y (meaning "and"), although this is less common than it used to be: Elí Arroyo y López.
Sometimes you will see names that are even longer. Although it isn't done much, at least formally, it is possible also to include grandparents' names in the mix.
Things can get a bit complicated for Spanish-speaking people living in places such as the United States, where it is not the norm to use two family names. One choice many make is for all family members to use the father's paternal family name. Also quite common is to hyphenate the two names, e.g., Elí Arroyo-López and Teresa García-Ramírez. Couples who have been in the United States a long time, particularly if they speak English, are more likely to give their children the father's name, following the dominant U.S. pattern. But practices vary.
The practice of a person being given two family names became the custom in Spain largely because of Arabic influence. The custom spread to the Americas during the years of conquest.