The only free and comprehensive online etymological dictionary of the Spanish language
mes m. (Noun) "month"
12th cent. From Latin mensis "moon," "month." From Proto-Italic *mēns- 'id.' From Proto-Indo-European *meh1-n-s- 'id.' Probably from *meh1- "to measure" (see médico, medir).
Indo-European
Romance
Asturian mes, Portuguese mês, Galician mes, Catalan mes, French mois, Italian mese, Aromanian mes, Sardinian mese
Italic
Umbrian menzne "by the moon," Marsian mesene "on the month"
Celtic
Old Irish "month," Middle Welsh mis 'id.,' Old Breton mis 'id.,' Old Cornish mis 'id.'
Germanic
Gothic mena "moon," Old Norse máni 'id.,' Old High German māno 'id.,' Old Saxon māno 'id.,' Old English mōna (English moon)
Albanian
Albanian muaj "month"
Balto-Slavic
Old Church Slavonic měsęcь "month," "moon," Russian mésjac "month," Czech měsíc "month," Slovene mẹ̑sec "month," "moon," Old Prussian menig "moon," Lithuanian mė́nesis "moon," "month," Latvian mẽness "moon"
Hellenic
Ancient Greek μήν (més) "moon," Attic μείς (meís) 'id.'
Armenian
Armenian amis "month"
Indo-Iranian
Sanskrit mā́s- "moon," "month," Old Avestan mā̊ 'id.'
Tocharian
A mañ "moon," "month," B meñe 'id.'

In most Indo-European languages, the word for "moon" mirrors the word for "month." The moon derives from *meh1- "to measure" due to its role as a conceptual marker of the month.