Мой, моя, моё, are first person, possessive, singular pronouns in the nominative (but not necessarily exclusively the nominative) case, corresponding to masculine, feminine, and neuter genders respectively. Я, мне, меня, are first person, singular pronouns, corresponding, but not limited, to the nominative, prepositional, and genitive cases respectively.
When to use them is best answered with tables, so here they are:
Pronoun tables - http://www.russianlessons.net/grammar/pronouns.php
A table of the cases and their uses - http://www.alphadictionary.com/rusgrammar/casefunc.html
O/c, the gender of the noun determines the gender of the possessive pronoun to which it belongs.