Except in the circumstances noted below, a character who is part of a unit of troops can leave during the Movement phase. A character is able to leave one unit of troops and join another in the same turn if you so wish, but he is unable to join and leave the same unit in the same turn.
A character may never leave or join a unit of troops while it is subject to a compulsory movement rule. For example, he cannot leave a unit which is fleeing, which has declared a charge, which has rallied that turn (because it cannot move) or which is engaged in close combat.
As mentioned above, if a character is with a unit when it declares a charge he must charge with it. However, if the unit he is with does not declare a charge, a character may declare a separate charge of his own and therefore leave the unit by charging out of it.
Once close combat has begun, a character will not be able to leave a unit he has joined until all the fighting is over and any compulsory movement, such as fleeing and pursuit, has been resolved.