Besides replacing a helmet that they've grown out of, you should always replace a helmet that's been in a crash which involves a head impact. The EPS foam and the shell may have been damaged and so they'll be less protective in a subsequent crash.
The same is true of a helmet that has been dropped. Although kids' helmets are usually designed with an extra level of abuse resistance over lightweight adult helmets, if it's fallen down the stairs, for example, it may have been damaged. A helmet should also be stored out of direct sunlight and shouldn't be left in a car on a hot day.
Most helmet makers say you should replace a helmet after a period of use, often five years, as the EPS foam will degrade over time. Your kid will almost certainly have grown out of their helmet by then, but it's worth keeping in mind for hand-me-downs.