"Por" indicates the agent in passive sentences "El caballo es comprado por Juan."
It also denotes the cause "cerrado por vacaciones"
the mode "Por las buenas."
the price "comprado por tres monedas."
the multiplication "Cinco por cinco"
"Para" denotes the end or term to which an action is directed.
to indicate the place or time to be deferred or determined to execute something or finish it "Pagará para mañana"