The fashion for bleaching has given us all the idea that teeth should be shining bright, so it's especially upsetting if teeth don't turn out even off-white. The good news is that in most cases something can be done to get the tooth back to a decently white or near white colour.
Discolouration often happens because of poor hygiene (tartar buildup), or is direct staining because of foods in the diet (coffee, cola, etc.). Smoking stains are another common problem.
If the tooth is damaged (as from an accident) it can turn grey because of death of the nerve underneath.
Some antibiotics, especially tetracyclines, taken during pregnancy or in a child's life before the age of 7 years, can lead to discoloured teeth in the child.
Excessive fluoride intake can lead to grey-black coloured teeth.
There are a large variety (too many to list and explain adequately) of other rare congenital conditions (either genetic or related to the womb environment) that can also lead to discoloured or mottled-looking teeth. Most of these are not easily avoided, though, it's a matter of luck.