Castellano or Castilian is the Spanish taught to North Americans and Europeans. Catalan and Gallego are regional languages for Catalonia and Galicia, linked to Castilian. Basque is a very different language, with lots of theories about whether or not it is closer to Finnish or Hungarian-- I think it safe to say that absolutely nobody will expect you to understand or speak it (although there are Basque language courses at the University of Idaho). Properly speaking, Aragonese and Leonese are dialects, and along those caminos, you will hear it from time to time in a few villages-- liturgy freaks can seek out Masses in Aragonese and Leonese in Huesca and Leon, if they are interested-- and they can occasionally be seen on signs.
However, everyone uses and understands Castellano. Unless you are in the Catalan-speaking regions of Catalonia, where pleasantries in the language are well-received, you will not need anything more than this. Note that English is not really used in northern Spain-- I found French to be almost as useful-- and it is not only a courtesy to use Castilian, it is really very very helpful. Being able to order your food, arrange accommodation, and follow basic directions will be of value to you. The more you can use it, especially in being able to provide a potted autobiography of oneself (where you're from, what you do, your family, what you like etc) will be welcomed by Spaniards, who are very social and love conversation.