It's acetylaldehyde, which is a transitional flavor yeasts create while converting sugars to alcohol. That "green apple" flavor is a sign of a very young beer that hasn't quite finished fermenting yet. If the beer was bottled prior to completing fermentation, this can happen, or if the yeast halts it's fermentation for whatever reason (cold crash, low oxygenated wort, lack of yeast nutrient, etc.).
The cure for it is to let your beer bottle condition for another week or two. The residual yeasts that carbonate your beer should continue to work on converting those green apple flavors into more interesting fruity esters.