Characters normally move and fight on their own. In effect, a character counts as an individual unit comprising of only one model. However, during the course of a battle, a character is allowed to join a friendly unit of troops - infantry, cavalry, unit of chariots or a war machine's crew, but never a monster, single chariot, unit of flyers or another character! In this case, he becomes part of that unit until he decides to leave it.
Characters mounted on flying creatures cannot join units. Characters mounted on chariots can only join units of chariots.
To join a unit of troops, a character has only to move so that he is touching it. Once he has joined the unit, the model is automatically placed in its front rank. Note that a character will inevitably use up a proportion of his move to reach the unit he is joining. If the unit has not already moved, its further movement is limited to the fraction remaining to the character. Any movement lost represents the time spent waiting for the character.
If there is no room for the character in the front rank of the formation (because the standard bearer, musician and champion and/or other characters take up all the available positions, for example), one of these models must be placed in the second rank of the unit. As long as a character remains in the back ranks he cannot fight (even with a spear), or use magic or magic items. Also the unit cannot use his Leadership value for tests. If the character is engaged in close combat (via a flank or rear charge, for example) it functions normally.
Characters cannot normally join or leave units in close combat, although they may obviously join the fight by charging their enemies. Characters cannot join a fleeing unit.
Except in the circumstances noted below, a character that 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 that is fleeing, which has charged during the same phase, 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 leaves the unit when he charges out of it.
Once close combat has begun, a character will not be able to leave a unit he has joined until the fighting is over and any compulsory movement, such as fleeing and pursuit, has been resolved.
The most important thing to remember when a character joins/leaves units as part of his move is that the character cannot use the fact he is joining/leaving units to extend his move beyond the distance he could have moved if he was simply moving on his own.
The following is an expanded explanation from the Official 7th Edition FAQ from January, 2009.
Placing the Character Inside the Unit
This works best when the character's base is larger than those of the unit's and is a multiple of them – for example a model mounted on a 40mm square base inside a unit of models with 20mm square bases, or a character on a 50mm square base inside a unit of models with 25mm square bases or a cavalry unit. In these cases, the character will fit in snugly and look and feel 'right'. It will also displace a number of models, which are placed in the rearmost rank as normal.
When working out the unit's rank bonus, the character counts as the same number of models it has displaced (normally four infantrymen or two cavalrymen).
This can also be done if the character's base is smaller than those of the unit he's joining or it does not fit neatly with those of the unit he joins (the most classic case being that of a character mounted on a horse joining an infantry unit with 20mm square bases).
In this case, however, you will have to slightly 'fudge' the unit's formation (that's a technical term, honest!). In other words, just pretend the character's base is the same as the other models in the unit (for foot characters), or equal to a multiple of the bases of the other models in the unit (for mounted or large models joining units of smaller bases…). This will make the formation a little messier, but it's normally quite self-evident.
Placing the Character Next to the Unit
This approach is not strictly speaking 'by the rules', but it's very simple (particularly for characters with bases that are different from the models in the unit they're joining) and thus a favourite in friendly games, but we really cannot recommend it in tournaments and other competitive games...
The character is simply placed in base contact with the flank of the unit, facing in the same direction as the rest of the unit and flush with the unit's front. It is treated as 'inside' the unit from all points of view, but the unit's formation is not disrupted by the character's differently-shaped base.
This works fine except if the unit is then charged in the flank where the character is, but with a bit of flexibility, and trying to apply the principles presented in Close Combat & Incomplete Ranks on page 36, you should be able to solve this easily.