European Portuguese differs from Brazilian Portuguese mainly in terms of pronunciation. There are also significant differences in vocabulary, and relatively minor differences in grammar and spelling. The relationship is similar to that between British and American English, though the regional differences in Brazil are greater than those in the USA.
The most noticeable differences in pronunciation are that European Portuguese uses a lot more sh and zh (as in pleasure) sounds than Brazilian Portuguese, and that some word endings are not usually pronounced in Portugal, while they are in Brazil. For example, the word saudade, sadness/longing, sounds something like ‘sao-oo-daad’ in Portugal, and like ‘sao-oo-daa-jay’ in Brazil. When an S comes at the end of a word in European Portuguese, it becomes a sh sound, as in Portugês ‘por-too-geysh’, which is pronounced ‘por-too-geys’ in Brazil, unless the following word begins with a vowel.
Brazilian Portuguese has absorbed many words from the languages of African slaves, from European languages such as French and Italian, and from indigenous languages of Brazil, such as Tupí and Guaraní, especially in place names and names of flora and fauna native to Brazil. Examples of words that are different in Brazil and Portugal include comboio (Pt) / trem (Br) – train (comboio = convoy in Brazil); autocarro (Pt) / ônibus (Br) – bus; pequeno almoço (Pt) / café da manhã (Br) – breakfast.
Grammatical differences include the disappearance of a number of tenses, such as the pluperfect from Brazilian Portuguese. The second person plural is used in Portugal but not in Brazil, and compound tenses are more widely used in Brazil than in Portugal.
In Brazilian Portuguese a number of letters such as c and p that have become silent are not written, while they are still written though not pronounced in European Portuguese. For example, acção (Pt) / ação (Br) – action, and óptimo (Pt) / ótimo (Br) – optimum. There are a number of other spelling differences, including the replacement of ó and é with ô and ê in many Brazilian Portuguese words.
Brazilian TV programmes and songs are popular in Portugual, so the Portuguese are fairly familiar with Brazilian Portuguese and have little difficult understanding it, though they may find some of vocabulary and grammar a bit strange. However few Brazilians are familiar with European Portuguese and can find it difficult to follow. Moreover Portuguese speakers can understand Spanish fairly well, but Spanish speakers find Portuguese, especially European Portuguese, much harder to make sense of.
Unless you plan to live or work in Portugal, or make regular visits there, it will probably be more useful to learn Brazilian Portuguese. Far more people speak Brazilan Portuguese, more courses and classes are available in that form of the language, and the majority of literature in Portuguese comes from Brazil.