As little as possibl. A cramping belly in a toddler benefits more from diet modification than any med. Avoid adult preparations of pepto-bismol as these have salycelates that are linked to REYE 's syndrome. Although children's pepto excludes salycelates, I seldom recommend anything. Popsicles, jello, applesauce, graham crackers, pasta & steamed rice are often tolerated by a crampy gut when they want to try eating.
Toddler bellyache. It depends on what you mean by "upset stomach." for vomiting severe enough to cause dehydration an anti-emetic may be given as a suppository (eg, phenergan). It the upset stomach is due to an obvious viral illness then just tylenol (acetaminophen) or Ibuprofen with plenty of fluids (or popsicles if s/he is vomiting) is appropriate. In general, children of this age are not recommended to take real medications.