Por qué
It serves to ask for a reason, it is used in interrogative sentences, direct and indirect. "Por" it is a preposition and "qué" is an interrogative (which is written with a tilde).
-"¿Por qué te cambiaste de trabajo?" (Interrogative direct)
-"No sé por qué ella siempre llega tarde a clases" (Interrogative indirect)
Porque
It is a causal conjunction and is used in sentences that explain the cause of the main sentence. It's equivalent to saying "Since" or "then".
-"Quiere pedir la cuenta porque no le gustó el servicio"
"Patricia no come carne porque es vegetariana"
Porque serves to answer a question entered by "Por qué".
¿Por qué es importante donar sangre? - Porque las donaciones de sangre contribuyen a salvar vidas
¿Por qué no has venido a la reunión? - Porque estoy enfermo.
Por que
Sequence composed of the preposition by and the relative pronoun that, is equivalent to using "which", "which", "which" or "which". Which means that there is a reference to an antecedent. (This form is currently used less).
-"Es el parque por que (por el cual) pasábamos de niños".
-"Muchas fueron las infracciones por que lo acusaron."
Porqué
It is a noun and is always preceded by an article or a possessive adjective. Why it can be replaced by "reason", "cause" or "reason".
-"Ellos explicaron el porqué de su conducta"
-"Él tiene un porqué para actuar así"
Because it is used as a noun, it can be used in the plural.
-"Ella comentó los porqués de su comportamiento"
<em>You have to take into account and pay close attention in the tildes, with time you will understand it and it will be easier for you.</em>