The only free and comprehensive online etymological dictionary of the Spanish language
mayor (Adjective) "larger," "older"
12th cent. From Latin maior 'id.' From Proto-Italic *mag-jo- "greater." From Proto-Indo-European *mǵ-i̯ó- 'id.' From *meǵ- "great." See also más.
As for the origin of the surname: the Mayor was the master of a farmhouse or estate, thus called during the Medieval period.
Indo-European
Romance
Asturian mayor, Portuguese maior, Galician maior, Catalan major, French majeur, maire, Italian maggiore, Romanian maior, Sardinian magiori
Celtic
Gaulish Magios (name) "great," Middle Irish maige "large"
Germanic
Gothic mikils "large," Old Norse mikill 'id.,' Old High German mihhil 'id.,' Old Saxon mikil 'id.,' Old English micel 'id.' (Middle English muchel, English much)
Albanian
Albanian madh "large"
Hellenic
Ancient Greek μέγας (mégas) "large"
Armenian
Armenian mec "large"
Indo-Iranian
Sanskrit máhi- "large," Avestan mazōi "big"
Tocharian
A māk "many," B māka 'id.'