I know they both mean for, but I'm trying to remember when to use each of them.
It is definitely tricky at first, like Valerie said. Both are prepositions that roughly translate to "for," but in reality have many different meanings. It is actually best NOT to think of them as meaning “for” because they have many significances and can usually mean whole phrases such as “in order to.” You can think about it this way: Para has a goal and direction in mind and por explains details. If you are running a race, para would be used to talk about the goal of crossing the finish line and por would describe the route you took and how long it took.
Para has less meanings than por and is used when there is a specific recipient, goal, or destination. It can sometimes be replaced with the phrases "in order to," or "headed to" or "the date it is due by" to verify that para is the correct option; para will always have a goal in mind.
-Para + infinitive verb= in order to
-Para + time/day=by (deadline)
-Para + place= headed towards destination
-Para + recipient (mí, ti, etc)= to be received by destined person. Gifts are an example
-Para mí or Para una anciana, etc= to express one's opinion about something or to express a point of view about someone who defies generalizations (Para mí, la corrida de toros es cruel. For me(in my opinion), bullfighting is cruel. OR Para una anciana, maneja bien. For an old woman, she drives well)
-To show the purpose/what something serves for (¿Para qué sirve un horno? Sirve para hornear comida. What purpose does an oven serve? Its purpose is to bake food)
Por takes on even more meanings. To give a rough overview, "por" is used to express passage of time or movement, mode of movement, reason why, or when things are exchanged. It can mean “through” or “by.” This list covers most but not all of its meanings:
-In exchange for (money, goods)
-Duration of time and general period of time(por la mañana, por un rato)
-Multiplication and division
-In support of, on behalf of (Luchamos por los derechos humanos. We fight for (in support of) human rights )
-By means of (airplane, walking, etc)
-Through, by the area of (park, city)
-Motive of, because of, or reason (No monté en la montaña rusa por miedo. I didn't get on the roller coaster because of fear)
-By (in passive constructions when showing who completed an action. You will see a conjugation of ser (es, fue, fueron) or estar(está, estuvo) then a past participle such as “hecho” or “escrito”) -El libro fue escrito por Kafka. The book was written by Kafka.
-Set expressions such as: gracias por, por ejemplo, por supuesto y mucho más
Contrasting examples: Estudié por dos horas. (I studied for two hours. This explains how I spent my two hours, but has no mention of a goal or deadline) Estudio para ser una abogada (I study in order to become a lawyer. This explains my goal for studying while “por” in the previous sentence just talks about a period of time) Mi tarea es para el lunes (My homework is due on Monday. The mention of a date is a deadline in this example)
Two last thoughts:
-Remember that when a verb is used right after a preposition (which por and para both are), it always stays in the infinitive. Para sacar una buena nota, hay que estudiar (In order to get a good grade...) or Gracias por ayudarme (Thanks for helping me)
-Parar is a verb that means “to stop.” The informal command for someone to stop is “Para.” I like to think of “para” as no-nonsense and straight-to-the-point. It has a goal in mind and it doesn’t care about the means of reaching the goal. So “por” is used for explaining the details and para doesn’t care about them. “Para” says stop to the details and just wants the goal and destination to be stated (It has the finish line in mind, like the race I mentioned at the end of the first paragraph)