The duration of Fear is dependent on several factors.
Fear has a potential PvE duration (versus mobs) of 20 seconds.
Fear has a potential PvP duration (versus players) of 8 seconds.
Fear has a damage limit. If the target takes damage equal to the limit, the Fear spell will break, regardless of the potential duration of the spell.
Casting Fear on your minion's current target will automatically cause your minion to stop attacking that target.
Numerous abilities and items such as PvP trinkets may allow players to break the fear effect prematurely, while others may render them immune.
When used against mobs, Fear will cause a patrol to aggro, even when glyphed.
Fear is subject to diminishing returns when used against players. Consequently, repeated use of fear effects upon a player within a 15 second period will reduce the duration of the effect considerably.
Fear is the only fear effect available to players that does not have a cooldown.
Patches and hotfixes
Patch 5.4.0 (2013-09-10): Fear can no longer cause targets under the effects of a movement speed buff to move faster than normal run speed. Additionally, Fear has a new visual spell effect.
Patch 5.0.4 (2012-08-28): Debuff can no longer be dispelled (but can still be removed with immunities).
Patch 3.0.2 (2008-10-14): Fear has a new visual spell effect.
Patch 1.8.0 (2005-10-10): Pets no longer break off attacks when their target is affected by Warlock Fear.
Patch 1.7.0 (2005-09-13): Will now cause creatures to flee immediately, even if they are already moving.
Patch 1.3.0 (2005-03-07): Mana cost changed to a percentage of base, which results in an increase in cost.
Patch 1.2.0 (2004-12-18): Players now have an increasing chance to break free of the effect, such that it is unlikely the effect will last more than 15 seconds.
Patch 1.1.0 (2004-11-07): Increased the chance of breaking early. Removed facing requirement.