"The woman eats an apple."
Translation:Die Frau isst einen Apfel.
I know this isn't actually explained anywhere on Duolingo (yet), so I can understand why this is confusing. Here's the thing. In this sentence, "the woman" is the subject and "an apple" is the direct object (the thing the woman is acting on).
In German, there is a concept of "case" that applies to nouns. What "case" a noun has depends on whether or not it's being used as the subject of the sentence (called "nominative case"), the direct object (called "accusative case") or the indirect object (called "dative case"). What version of "ein" you use depends on BOTH the GENDER of the noun and the CASE of the noun.
In this particular example, Apfel is a masculine noun (male gender), and, because it is being used as a direct object in this sentence, it is in the accusative case. Male nouns in the accusative case use an -en ending on the base "ein", and that's why it's "einen" here.
I know this is confusing when it's written out verbally as I've done here. What you really need is a table that shows you which version of "ein" to use for all the cases and genders. And I've got one for you! Please see the following Wikipedia article (specifically the table called "Indefinite article endings (mixed)" near the top).
der Apfel is a masculine noun.
ein Apfel is in the nominative case (the subject) einen Apfel is in the accusative case (the direct object)
Ich esse den Apfel. 'den Apfel' is in the accusative case, because it is the direct object of the verb 'essen' (or conjugated to 'esse' owing to 'ich')
An easy question to determine whether a noun is in the accusative case: I am eating an apple. What am I eating??? an apple. Thus, "Ich esse (insert noun and definite article in accusative case.)
Hope this clears up further issues with the accusative case.
There are some rules that in most cases can help you to figure out what gender is a noun for example 60% of nouns that ends in -el, -er, en, are masculine, but that is almost half of it so yes the best way is by familiarity, I would recommend the book Hammer's German Grammar and Usage for more information =)