I used the parish archives in Portugal to trace my entire family tree on all sides to the early 17th century and there are some 4,000 individuals on it thus far. My family comes from a small town in central Portugal, and after speaking with genealogists I discovered the following about surnames. My family overwhelmingly comes from a cluster of villages and only in the 18th century did I find a few people coming from further afield in my family tree (including two individuals from Galicia and one from Dax in France). Individuals seem to intermarried within their villages, and while marrying first cousins seemed to have been rare, marriages between second and third cousins were exceedingly common. Additionally, Old Christians seemed to marry only other Old Christians as a stigma against Old Christians. My ancestors come from a few Old Christian villages, and though there was a neighbouring New Christian village, and there were hardly any intermarriages between the two, I could only count one marriage in the 19th century. The villages my ancestors came from tended to choose mates from further afield, and avoid choosing mates from New Christian areas. I found the status from looking at Inquisition Records, as there were a few women tried of witchcraft in my parents' village, and were called Old Christians, at the time there were only around 250 individuals there and most were interrelated in some form. By the 20th century, most inhabitants were descended from these few hundred individuals. According to older people from the village there was a mistrust against this other village and no one was sure why, they were said to have "bad blood". This persisted until the 20th century. Even then there seems to have existed a continuing distrust of outisiders.
In this region, the most common surnames in the villages during the 17th century were Antunes, Bernarda, Fernandes, Francisco, Lopes, Martins, Mendes, Nunes, Ramos, Reis, Rodrigues, Silva, Simão. Some such as Bernarda, Francisco, and Simão were passed onto children from the parents' given names. For instance, a woman named Bernarda born in 1588 had a few children and they took on the name da Bernarda.
Until the early 20th century Portuguese surnames were often chosen arbitrarily. The eldest son almost always took his father's surname, but other children particularly daughters would often take their mother's surname. Surnames such as Ferreiro came from a iron worker, surnames that were proper names often came from an individual's descendants whom were known as sons of or daughters of an individual. Additionally, outsiders to a village would often take the surname of their hometown as that is how they were known. Some would take on the name of a part of the village they lived, this is the case of my surname as my 3rd Great-Grandfather whom begins to show up with a different surname at his time of marriage (1861) than when he was baptised (1828). The reason seems to be that he shared the same name as two cousins, and as a result, he either took or was given the name of his section of the village as a surname. Others were given the surnames of other relatives, primarily if they were prominent people, for instance I have an army captain (Capitão-mor) in my ancestry in the 18th century whom gave his name as godfather to a few others of whom he had been chosen as Godfather. During the Estado Novo the system of children taking their father's surname as their principal name became the norm.