Under what conditions is a flight attendant required on an aircraft?
14 CFR Part § 121.391.

It depends on the size/weight of the airplane and how many passengers it can hold


  Except as specified in § 121.393 and § 121.394, each certificate
  holder must provide at least the following flight attendants on board
  each passenger-carrying airplane when passengers are on board: 
  
  
  For airplanes having a maximum payload capacity of more than 7,500 pounds
  and having a seating capacity of more than 9 but less than 51
  passengers—one flight attendant.
  For airplanes having a maximum
  payload capacity of 7,500 pounds or less and having a seating capacity
  of more than 19 but less than 51 passengers—one flight attendant. 
  For airplanes having a seating capacity of more than 50 but less than
  101 passengers—two flight attendants.
  For airplanes having a seating capacity of more than 100 passengers—two flight 
  attendants plus one additional flight attendant for each unit (or part of a unit)
  of 50 passenger seats above a seating capacity of 100 passengers.
  


http://www.gpo.gov/fdsys/pkg/CFR-2011-title14-vol3/pdf/CFR-2011-title14-vol3-sec121-391.pdf

Parts § 121.393,394 relax these requirements when a plane stops, but denotes how close by the flight attendants must be, and other things like exit door requirements.

Remember, Flight Attendants are there for your safety :) which is the motivation for these regulations.

[Edit]
14 CFR Part 91.533 covers flights operated under "Part 91" regulations:

§ 91.533 Flight attendant requirements.


  
  No person may operate an airplane unless at least the following number of flight attendants are on board the airplane:
  
  
  For airplanes having more than 19 but less than 51 passengers on board, one flight attendant.
  For airplanes having more than 50 but less than 101 passengers on board, two flight attendants.
  For airplanes having more than 100 passengers on board, two flight attendants plus one additional flight attendant for each unit (or part
  of a unit) of 50 passengers above 100.
  
  No person may serve as a flight attendant on an airplane when required by paragraph (a) of this section unless that person has
  demonstrated to the pilot in command familiarity with the necessary
  functions to be performed in an emergency or a situation requiring
  emergency evacuation and is capable of using the emergency equipment
  installed on that airplane.
  


It looks like the "training" to act as a Part 91 Flight Attendant is just showing the pilot they are capable.

The big difference between Part 121 and Part 91, is number of seats (potential capacity) vs. people actually on board.  This is interesting in light of the recent 787 Boeing Business Jet deliveries (http://boeing.mediaroom.com/2014-02-05-Boeing-Business-Jets-Delivers-First-Two-BBJ-787-8s-of-2014).  So if it was just the owner and the pilot crew, there wouldn't need to be a flight attendant (assuming, of course, they're operating under Part 91), even though it is a huge plane.