The full answer is difficult to explain.
por is always used with time.
if I am physical giving someone or if someone is reciving what I am saying you you use para or "pra" which is the popular spoken form of para.
parabéns par você = Happy Birthday to you.
if I do somthing on your behalf I belive to use por
"for the" or "por o" becomes pelo
"for the" or "por a" becomes pela
"to the" can become "ao" or "á" depending on the word around it.
nos vomos ao cinema
a gente via pra cinema
The second sentence means the same thing but is conjugated differently and is a bit less formal (a gente means also means "we").
This is what I can think of now but I'm sure I left something out.