1. Don't eat too much apples before going to bed.

2. Don't eat too many apples before going to bed.

(Which one is grammatical?)

3. His hobby is riding a horse.
4. His hobby is to ride a horse.
5. His hobby is riding on a horse.
(Are all grammatical?)

6. His job is selling cars.
7. His job is to sell cars.
(Are both correct?)

2 answers

#1 is grammatical.

#3 is grammatical

#6 and 7 are both grammatical but #7 is better usage.
#1 is incorrect; #2 is correct.

"Apples" = a count noun:
http://grammar.ccc.commnet.edu/grammar/noncount.htm