The national language of Spain is Castilian, additionally there are 7 officially recognised provincial languages. Following the death of Franco, during whose rule tuition and official use of regional languages was outlawed, there has been a resurgence in the use of these local languages. In some areas this has been almost to the exclusion of Castilian Spanish, although there are governmental moves to redress this and ensure a more balanced approach.
The Languages of Spain
Internationally recognised as Spanish or Espagñol and spoken by about 75% of the population. Worldwide it is estimated that in excess of 350 million people in 44 countries use Castilion and its regional variants as their first language.
Catalan Catala and Valencian Valenciana
This group of languages is spoken by an estimated 10 million people, with perhaps 7 million using it as their primary language. Geographically, it is spoken in the provinces of the eastern seaboard; Catalonia (official language), Valencia (Valenciana, official language) and the Balearic Isles (Balear Catalan, official language) as well as part of Aragon.
It is also spoken in Andorra, France and Sardinia and is the 21st most commonly spoken language in europe (out of 56)
Galician, which is more akin to Portuguese than Castilian, is the language of the north west of Spain where it is spoken by 3 million people. It is a language with a long literary history.
The language of some 600,000 in the three Basque provinces of Alava (Araba), Biskaia (Biskay) & Gipuzkoa and the northern part of Navarra , as well as about 100,000 in the Pyrénées-Atlantiques region of France. This ancient language is unrelated to any other european language. Its origins are unknown.
About 450,000 people speak Asturian in the northern province of Asturia, 100,000 as their main language.
Some 200,000 regularly use this archaic Leonese dialect of Castilian.
Other indiginous languages
Languages such as Aragonese (perhaps 30,000 speakers), Fala (10,000 speakers) and Occitan (Gascon, Aranese) though generally supported by local statute, currently have limited representation in the local media or school curriculum.
My advice is learn the national language; it is most useful wherever you go in Spain and in much of South America. There are good full time private Residential Colleges for learning Spanish in various parts of Spain, also Spanish evening classes in almost every area of Spain, both local authority run and private. The Spanish appreciate you trying to learn their language and even when you make a total hash of it, as I often do, they are extremely friendly and enthusiastic. It is well worth the effort.
To find out what courses and materials are available to help you discover the Spanish language both before moving to Spain and once you have settled into your new home, read my article Learning Spanish