Leaves are green in color due to the presence of a chemical called chlorophyll which is also responsible for the conversion of water and carbon dioxide into glucose in the presence of sunlight. This is the food that plants survive on.
In addition to chlorophyll, leaves also have various chemicals that have a different color. Examples of these are tannin, anthocyanins, carotene and xanthophyll. Most of these other chemicals are always present in the leaves though they are not visible due to the green color of chlorophyll. Some of these chemicals are produced before the leaves are going to fall off, either from the waste contained in the leaves or due to their special purpose for the plant.
As the amount of sunlight available for plants decreases, there is a lesser requirement for them to produce chlorophyll in their leaves. This allows the other colors to become visible and the leaves change color.