There are three declension classes for nouns in German: 'strong nouns' (the 'normal' ones'), weak nouns and nominalised adjectives. The latter get declined exactly like adjectives. Weak nouns often (but not always) were nominalised adjectives once that don't feel like adjectives any more. An example for a nominalised adjective is 'der Alte'. Interestingly, 'der Junge' is a weak noun. Here the declension patterns for the two examples:
nominative: der Junge, der Alte, ein Junge, ein Alter
genitive: des Jungen, des Alten, eines Jungen, eines Alten
dative: dem Jungen, dem Alten, einem Jungen, einem Alten
accusative: den Jungen, den Alten, einen Jungen, einen Alten
As you see from this table, the "adjectiveness" of 'der Alte' shines through in nominative if used with an indefinite (or without an) article.
Like gender, it's arbitrary. The one big rule of thumb is 'if it seems to be derived from an adjective: be suspicious'. There are not too many weak nouns around. The most prominent examples on duolingo are 'der Junge' and 'der Elefant'. I'm a bit reluctant to link to this source http://german.about.com/od/grammar/a/dernouns.htm because they don't distinguish between weak nouns and nominalised adjectives which you certainly should do. But they list some of the most important non-strong nouns.
nominative is used if the noun is the subject of a verb - in english we don't have different cases for most nouns, but we do for pronouns - e.g."I go", rather than "me go" and "he sees" rather than "him sees".
accusative is used when the noun is the direct object of a verb - e.g. the boy sees ME (accusative) or i help HIM
dative is for indirect objects - something done TO an object e.g. the boy gives the girl a book (the boy gives a book TO the girl) - the girl is the indirect object
genitive shows possession and is usually represented by the " 's " ending in english, or "of the" - such as "the girl's car" or "the car of the girl"
hope that help you
The way I remember the difference is by this sentence:
Der Mann gibt den Apfel zu dem Junge (the man gives the apple to the boy).
"Der Mann" is the nominative article - he is what is doing or being something. "Den Apfel" is the accusative article - it is being directly affected by a verb. "Dem Junge" is the dative article - he is the indirectly being affected by the verb.
I haven't come across genitive just yet, but I'm hoping this helps.