A unit which fails its Terror test will flee away from the source of its terror as if it had failed its Break test in close combat or had decided to flee from a charge.
A unit being charged will flee immediately like any unit which flees from a charge.
A unit attempting to charge or failing a test at the start of its turn will flee in the compulsory movement part of its Movement phase.
A unit which flees in terror because of an enemy within 6" at the start of its turn may not attempt to rally that turn. It will flee in the compulsory part of its Movement phase, in the same way as a unit which panics because of fleeing friends within 4" (see Panic).
Remember that only a single test is ever made for terror by any unit during the whole game, whether it is made because of a charge or because the unit finds itself within 6" of a terrifying monster.