Why and Because in Brazilian Portuguese
In Portuguese, the words for 'why' and for 'because' are theoretically the same - 'por que' written separately is mainly used for 'why', while 'porque' written altogether means 'porque'. They do sound the same - except for some occasional differences in stress and emphasis. There are a few other meanings apart from these two basic ones, and this leads to four possible combinations regarding whether the expression is written as a single word or not and whether it takes an accent mark or not. These differences in spelling account for some of the most frightening nightmares in the Portuguese classes for native elementary and high school students. Fortunately, it seems to be a bit easier to sort things out when explaining it in English, as some of the ambiguities are gone because they correspond to different words in English.
Let us first analyze the two components of this word/expression: 'por' is a preposition that, like any other, has several meanings, in this case ranging from 'by', to 'for' and occasionally 'through'. 'Que' is a typical grammatical word: a conjunction, an interrogative, a relative pronoun. In this case, let us consider 'por' as a preposition which means 'by' and 'que' as a pronoun which means...'which'. So, 'por que' is literary 'by which' and thus it is used when asking for or giving explanations about something.
The four possible spellings mentioned about help clear out the different usages of 'por que':
'Por que' - that is, 'separado e sem acento' (=written separately and with no stress mark) basically means why:
'Por que você não foi à escola? = 'Why didn't you go to school?'
It is also used in indirect questions:
'Eu não sei por que ela não veio à festa.' = 'I don't know why she didn't come to the party'.
One could also have said 'Eu não sei por que razão ela não veio à festa', with 'razão' meaning 'reason'. So, in this sentence 'por que' should really be seen as two separate words with a noun 'razão' being implied.
Remember that 'por' can also mean 'by, through'. Since 'que' means 'which', there is also the possibility that 'por que' will just mean 'by which', with no causal/interrogative meaning. A remarkable example can be found in the verses of the Brazilian singer Djavan:
'Só eu sei as esquinas por que passei' = 'Only I know the corners through which I passed', or, less directly, 'I am the only one who knows the corners I went through'. This sentence does sound slightly literary, as the most expected relative pronoun in such context would be 'onde', 'where': A estrada por onde eu passei está em manutenção. = The road I went through is undergoing maintenance.
'Por quê' - that is, 'separado e com acento' (=written separately and carrying a stress mark). This is basically the stressed, more emphatic version of 'por que'. It is used standalone and when at the end of a sentence. When 'por que' is moved to the end of the sentence, it then takes the focus of the whole sentence, and hence the stress/emphasis which is demonstrated through the stress mark.
'Você não vem mesmo? 'Por quê?' = 'You aren't really coming? Why?'
'Ele não fez o trabalho por quê?' = 'Why didn't he do the job'?, this usage being rather emphatic and typical of the spoken language.
'Porque', that is, 'junto e sem acento' (=written altogether and with no stress mark) basically means 'because'.
'Minha mãe não veio porque não quis' = 'My mother didn't come because she didn't want to'.
Bear in mind that 'because of' is translated with 'por causa de'. So, 'because of you' translates as 'por causa de você'.
'Porquê' - that is, 'junto e com acento' (=written altogether and carrying a stress mark) is basically a noun that was derived from those grammatical words. It translates as 'the reason', 'the reason why' and it is always preceded by the definite article 'o'.
Cientistas ainda estão tentando descobrir o porquê da mudança das marés = Scientists are still trying to find the reason why tidal flows have changed.
This list is not intended to be exhaustive and applies only to the Portuguese in Brazil. It is nevertheless a safe guide for the most common usages of 'por que'.