The question of "a" vs "an" is always decided by the pronunciation of the word that follows the article. Thus, various geographical regions that have different pronunciation rules may use a different article for the same word.
Words that begin with a vowel sound, such as "apple", "egg", or "hour" are preceded by "an".
All other words, such as "cake", "pie", and "user" (which begins with a y
sound), are preceded by "a".
Except (as lifted from @Nohat's comment below) - The rules before "h" are a little tricky, but clear: if a word begins with an "h" sound and the first syllable is stressed (like "hotel""house"), then it never takes "an". If the first syllable is not stressed (like "historical") then it is possible to use "an". Some usage authorities would say you must use "an" in those cases, but Nohat is not one of those authorities. You find both "a" and "an" used before words like "historical".
So to answer your actual question:
He ate a green apple.
He ate an enormous Pop-Tart.
"Green" does not begin with a vowel sound, so we use "a".
"Enormous", on the other hand, does begin with a vowel sound, so we use "an".