In Spanish, The key to understanding which preposition to use is to think of the meaning you want to convey. If I use a phrase such as "three for a dollar" in English, the "for" has a different meaning than it does in "this book is for you." In the first case, "for" indicates an exchange or a rate, while in the second case it indicates an intention or direction. Thus the Spanish translation of the two phrases are different, "tres por un dólar" and "este libro es para ti."
The following chart shows some of the major uses of these two prepositions.
Uses for por:
Expressing movement along, through, around, by or about: Anduve por las calles de la ciudad. I walked through the streets of the city.
Denoting a time or duration when something occurs. Viajamos por tres semanas. We're traveling for three weeks.
Expressing the cause not the purpose) of an action: Me caí por la nieve. I fell down because of the snow.
Meaning per: Dos por ciento.Two percent.
Meaning supporting or in favor of: Trabajamos por derechos humanos. We work for human rights.
Introducing the agent of an action after a passive verb: Fue escrito por Bob Woodward. It was written by Bob Woodward.
Indicating means of transportation: Viajaré por avión. I will travel by plane.
Used in numerous expressions: Por ejemplo. For example. Por favor. Please.
Uses for para:
Meaning for the purpose of or in order to: Para bailar la bamba, necesita una poca de gracia. In order to dance the bamba you need a little grace.
With a noun or pronoun as object, meaning for the benefit of or directed to: Es para usted. It's for you.
Meaning to or in the direction of when referring to a specific place: Voy para Europa. I'm heading to Europe.
Meaning by or for when referring to a specific time: Necesito el regalo para mañana. I need the gift for tomorrow. Vamos a la casa de mi madre para el fin de semana. We're going to my mother's for the weekend.