As Laura has said it, it's accusative case of the male definite article 'der'.
I can just add that accusative (Akkusativ) roughly corresponds to direct objects of English transitive verbs (like her in 'he loves her' ) - and that's true for all languages by the definition of accusative.
Not really always it corresponds well, but the idea is clear: you eat the apple.
Not 'of the apple' or 'to the apple' or 'by the apple' etc. So, accusative.