Por and para can be confusing, as they can both be translated as for in certain sentences. Here's how to use them correctly:
We use para for:
Compré un regalo para Ana. I bought a present for Ana.
Compré una mesa para mi apartamento. I bought a table for my apartment.
Iré para Boston el viernes. I’m going to Boston on Friday.
Como verduras para estar sana. I eat veggies in order to be healthy.
Voy a ir a Madrid para visitar a mis amigos. I’m going to Madrid in order to visit my friends.
Necesito el informe para el martes. I need the report for/by Tuesday.
We use por for:
Trabajo por ocho horas cada día.[3] I work for eight hours every day.
Berges Institute está cerrado por Thanksgiving. Berges Institute is closed “because of” Thanksgiving.
Llegué tarde por el tráfico. I got there late because of the traffic.
Compré un par de zapatos por 100 euros. I bought a pair of shoes for 100 euros.
Cambié mi guitarra acústica por una eléctrica. I exchanged my acoustic guitar for an electric one.
Voy al gimnasio tres veces por semana. I go to the gym three times per week.
**********
[1] In this example, we could use a instead of para with the same meaning: Iré a Boston el viernes.
[2] When using para as in order to, we usually use it with the infinitive form of a verb: Fui a New Jersey para visitar a mi amiga. (I went to New Jersey [in order] to visit my friend.) Voy al gimnasio para estar fuerte. (I go to the gym in order to be/to stay strong.)
[3] For periods of time, por is frequently omitted: Trabajo ocho horas cada día.
[4] When using por as because of, we usually use it with a noun: El metro no funciona por un incidente. (The subway does not work because of an incident.)