Any time the vomiting lasts for over a day, is bloody, is projectile or your dog is exhibiting multiple symptoms (diarrhea, vomiting, fever, pain, etc), call or go to your vet. Like diarrhea, vomiting affects their fluid and nutrients and if untreated, can be serious enough to cause death. Vomiting can also be a minor condition (eating too fast, a new food, excitement/stress). If the condition lasts more than 12 hours (less if a smaller, older/younger dog) or if it has the above symptoms, call or see your vet.
There are many things that can cause vomiting– food allergy, parasites, worms, inflammatory bowel disease (IBD), stomach ulcers or cancer, obstructions/foreign bodies, hernias, pancreatitis, gastritis, side effects of medications and many other conditions. Again, check with your vet.
If you want to get more graphic details about the different causes, Washington State College of Veterinary Medicine can provide you with some of the detail...click here