Before you eat.
30 minutes after you eat.
Traditionally people believe brushing after a meal is the best time to clean the teeth. While it is true that you will clean your teeth of food, you might actually be doing more harm than good.
An article by Dr. Scott Frey explains that bacteria cause cavities by feeding on the fermentable carbohydrates they find on our teeth; fermentable carbohydrates means sugar in any form including, bread, pasta, candy, potatoes, any baked good, cereal, oatmeal, grains. After we eat, the bacteria create acids as they digest the carbohydrates in the foods.
This acid slowly weakens the enamel on our teeth. When you brush afterwards, the abrasive action of the brushing scrapes away the weakened enamel and exposing our teeth to the hungry bacteria. The best time to brush is before a meal, which reduces the amount of bacteria that can create an acid environment and destroy our enamel.
It takes about 30 minutes for our body to neutralize the acid from the bacteria, so wait at least that long to brush, or use some floss to remove unsightly greens. (http://www.freysmiles.com/blog/view/should-you-brush-teeth-before-or-after-eating)