Most spells are cast instantly and their effect is worked out at once. For example, a magic missile spell is cast, it strikes a target and damage is resolved. In this case, the spell has no further effect in the game during the same magic phase, and the spell cannot be cast again in that magic phase, as normal.
Some spells last for longer than this and they are clearly marked as 'remains in play' in their description. Once cast, one of these spells lasts until it is dispelled, until the Wizard chooses to end it (which he can do at any time), attempts to cast another spell, leaves the table or is slain. Obviously, these spells cannot be cast again by the same Wizard while in play.
If a character under the effects of a spell that remains in play joins a unit, the spell does not affect the unit.
If a character joins a unit that is under the effects of a spell that remains in play, the spell will affect the character as well as long as he is with the unit. If a character and a unit are under the effects of a spell that remains in play, and then the character leaves the unit, the caster must decide which one will be affected from then onwards - character or unit.
Note that there may be exceptions to the above rules, and they will be specified in the spell description or other special rules.