Character movement usually interrupts a spell you are casting. Stunning a mob will usually interrupt spells being cast on you. If executing a macro, starting another macro will interrupt. Resting mid-spell always works, as it cancels out spells that cast fast.
Occasionally a spell will still go off if you run. If its very important to cancel casting, use the /heal command. This will cancel 100% of the time.