为了means in order to/for/because of
1 when 为了is followed by sb. it usually means "for" maybe you want to be with this guy, or this guy will benefit or has already benefited from the action.
为了你我来到上海。(为了和你在一起) I came to shanghai for you/in order to be with you.
为了你我打算辞职。(为了照顾你) I am going to quit my job for you/in order to have enough time to take good care of you.
The real reason depends on the background. Mandarin usually doesn't explain the details much, they just put "sb."behind 为了.
1 when 为了is followed by sth./an purpose. it usually means "for""because of""over"
为了这件事她生气了。She has been angery over this matter.
为了得到这笔钱我坐牢了。 I have been in prison because of trying to get this sum of money.
为了成功干杯。Cheers for success.
You see, 为了... the main action can be in any tense accoring to the fact.
But if 了is after an action, that usually means this action happened already in the past.
她为我哭了。 She cried because of me.
他为孩子们买了一些书。He bought some books for the children.
我为他辞职了。I quit my job for him.
in fact, if it's a pronoun following 为, you can also say
她为了我哭了。
我为了他辞职了。