Spanish is spoken by more than 500 million people and it is the oficial language in 20 countries. Hence, it is not a uniform language but it has various dialectal varieties.
In general terms, 8 different dialects can be distinguished: the Castilian, the Andalusian and the Canary in Spain, and the Caribbean, the Mexican-Central American, the Andean, the Chilean and the “Rioplatense” in America. Despite this classification, there are many other geographical and social varieties that differ between them by multiple reasons (phonetics/pronunciation, grammar and vocabulary).
An example of a phonetic difference is the “seseo”. Most of the speakers in Spain say “cereza” and “cebolla” while in America they pronounce it [seresa] and [sebolla].
As for the grammar, the most remarkable difference is the “voseo”. In Spain people use the pronoun “tú” (informal “you”), but in America speakers use “vos”, which results in differences in the conjugation of the verbs.
Finally, there are differences in the vocabulary. Thus, while in Spain the word for “car” is “coche”, in Argentina and Mexico it is “carro”, and while in Spain people say “bonito” for “pretty”, in Mexico they say “lindo”.
Are those different dialects a difficulty when trying to learn Spanish?
It is true that all Spanish native speakers understand each other without big comprehension problems, even if sometimes a vocabulary clarification is needed. Moreover, the teaching of Spanish as a foreign language is conceived in a way that students are exposed, in class, to the different dialectal varieties. However, if the student knows in advance in which context they will be using the language, it might be useful to have a teacher of that specific dialect.