While Americans tend to learn Mexican or Argentine Spanish at school, there will be some differences to look out for if planning on speaking and continuing to learn the language in Spain.
While there is little difference in grammar between the many Spanish dialects, there are conjugations and accents that differ between the Spanish of the Americas and European Spanish.
While in Spain, firstly, notice that there is a big difference between the northern Castilian dialects and the southern Andalusian dialects of Castilian Spanish. The Andalusian dialect is the one that closer ressembles the Spanish of Latin America. The major difference is the fact that in Spain, the Castilian Spanish replaces any “s” sounds with a “th”.
While Mexican Spanish incorporates “tl” and “tz” in certain words because of a heavy Native American influence in their language, Spain too has localized intonations in their dialects.
When traveling to Spain, keep in mind there are regional languages. For example, if planning on going to Barcelona, then your classical Spanish will get you by, but the local language of Catalan is also used in street signage and sometimes in conversation. In other parts of Spain, Galician and Basque are spoken. Be sure to check which region speaks which local language before you go.
There are differences in vocabulary between Latin American countries and Spain as well, mostly with food products. Again, this is because of the Native American influence in Central and South America. But do not be too stressed if visiting Spain from America because in general, there is a wide cross-understanding of all dialects and most people understand that a large variant of Spanish is spoken throughout the world.