How does color work? My teacher said "Red apple is red because it absorb all light and reflect only red while our eyes can detect all light"
I know that all object/thing made of atoms so different atoms are the source of different color. 
My main question is:
"How can atoms reflect different colors? Is it because electron excitation and de-excitation?"
 A: Light is electromagnetic radiation . Electromagnetic radiation of a single frequency is in a one to one correspondence with the color scheme of the rainbow spectrum for visible frequencies. With a definite  frequency of visible  light, the color we see is determined by the location of the frequency in the spectrum.

White light is not identified with a single frequency , it is a mixture of many frequencies.Viewing colors is a biological process that depends on how the rods in the retina perceive color, it is called color perception..
The color of the apple does depend on the reflected frequencies when illuminated by white light, but "white light" contains many frequencies and how these are absorbed and reflected by the apple and how the are  perceived by the eye is a  complex process that includes many frequencies that build up the perception of the colors identified as "red for an apple". Percieved red contains many frequencies as seen below.

So it is more complicated than absorption and refection by atoms, reflections and absorptions  play the primary role but the color perceived depends on biology.
Excitation of the surface atoms and molecules and deexcitations play a smaller role because directionality is lost in reemission after absorption.
