They're all variations of the German word for a/an.
If you've got a subject (as in the sentence "A cat sat on the mat"), then you use ein for masculine and neuter nouns and eine for feminine nouns (in this case "Eine Katze . . .", since Katze is feminine).
Other variations are einem (for indirect objects that are masculine or neuter), einen (for direct objects that are masculine), eines (for possessives that are masculine or neuter) and einer (for indirect objects or possessives that are feminine).
By the way, Germans will explain these using the terms nominative, dative, genitive, and accusitive. These for terms are roughly equivalent to subject, indirect object, possessive, and direct object, respectively.
BTW, I'm an American who's been living in Germany for 15 years and I still stumble over this stuff -- it's hard to memorize the genders of all the nouns.