I really thought it funny how English has so few cases and so I decided to give a brief explanation about this.
The three cases in English are [NOM] or nominative, [GEN] or genitive and [ACC] or accusative.
Generally, grammar books explain in great detail when to use them, but I found that it is easier with fewer rules. So, generative grammar helps here.
Nominative is used for the subjects of finite clauses - I am here. We love biscuits. He spoke to me.
Genitive is used for possessors - That's my hat. She's his mother.
Accusative is the default case and is used everywhere else - Give her the book. I spoke to him about it. This is for him. For him to be absent...
So, basically, the rule for Case assignment is as follows: If it's a subject of a finite clause/ verb, assign feature [NOM]. If it's a possessor, assign [GEN]. Everywhere else, assign [ACC]. This then covers a whole range of situations where accusative appears, including direct and indirect object (in English, it appears that accusative has taken over the role of dative as well) and the subjects of non-finite clauses with preposition for, as well as the prepositional objects (to me, for him).