What determines the "acceleration" and "thrust reduction" heights?
(Highlight mine.)

Short answer: airport briefing.

If no restrictions, then company SOP.

Thrust reduction is usually set to activate once the plane clears the noise abatement and/or MSA (Minimum Sector Altitude).

VNAV takes care of acceleration when activated as long as the SID is programmed. It also warns the crew if constraints will not be met.

Boeing 737NG VNAV. (Highlight mine.)



From Skybrary:


  Thrust Reduction and Acceleration Procedures
  
  On take-off, in order to position the aircraft to a safe height away from terrain and obstacles (i.e. a flight path of maximum height and minimum ground distance desired), the engine thrust is set to a high ‘take-off power’ setting (although this is not necessarily full power) and the aircraft attitude is pitched up to maintain a specific speed (usually in the region of V2 + 15kts). Once the ‘safe height’ is reached the engine thrust can therefore be reduced to a more appropriate (i.e. efficient) setting and the aircraft flight path can be changed to a more appropriate (i.e. efficient) flight path.
  
  In order to achieve that described above and also to provide minimum noise disturbance to the area surrounding the airport, regulatory procedures require aircraft to fly one of the two profiles given below during every departure. The aerodrome briefing pages will state which one of the two profiles is to be flown at each particular airport:
  
  
    
    At 1,500ft aal reduce thrust to climb power and accelerate the aircraft towards 250 knots, retracting flaps and slats.
    At 1,500ft aal reduce thrust to climb power maintaining V2 + 15kts. At 3,000ft accelerate the aircraft.
    
  
  
  Operator’s SOPs must therefore enable the above procedures to be flown.


Typical Boeing 737 climb profile:



Acceleration here would happen at (2) when VNAV is engaged. Default acceleration height depends on the airline, manual entry is possible from 400 to 9999 feet.

The default thrust reduction height is 1500 feet (lowest manual entry is 800).