Stealth is a level 3 rogue ability that prevents other creatures from detecting the stealthed player unless particularly close.
Attacking and most actions such as looting will cancel Stealth. Taking any damage will cancel Stealth, including direct, AoE and DoT damage, and environmental damage such as fires. However, Stealth does not break from falling damage, unless of course it kills the stealthed unit. You cannot enter Stealth while in combat.
Stealth is not invisibility. You can be detected by others. Monsters that detect you may stop in their tracks and turn to face you, or attack you directly. Players that detect you will hear a sound, and will be able to target you. The chance of detection increases as you get closer, but also depends on the viewing angle (stand right in front of an enemy and you can guarantee they'll see you), the relative levels, and any perception or subtlety modifiers.
Taking any action such as looting or attacking will remove stealth. There are a few exceptions, such as [Distract], or [Pick Pocket]. However, sapping an opponent does not remove the rogue's stealth.
Fear AoE's and certain other AoE's will remove Stealth.
Enemies much higher in level will tend to see through Stealth from quite a distance.
Enemies you are in front of will see through Stealth as you get closer.
You cannot enter stealth while combat. However, rogues can use [Vanish] to equivalent effect. Note that if you have a DoT the Stealth will break the next time it damages you; if possible, use [Cloak of Shadows] to first remove the DoT (if it's a magic effect), then Vanish.
Certain enemies, also called truesight, are immune to stealth. These are normally extrasensory beasts (hounds or wolves who can smell/hear the player), extremely powerful boss characters, and certain magical creatures. These anti-stealth NPCs can be recognized by a symbol over their head, of a blue sphere with a roving eye. The symbol appears once you enter stealth, but is not visible when out of stealth. These creeps will thus react to you as if you were not stealthed, and aggro normally. However, they won't be able to see you when their backs are turned, so it is possible to sap truesight humanoids, but requires skill and perfect timing.
Applying poisons to your weapons does not break stealth.
If you start eating while stealthed, it will break your stealth, but you can enter stealth while eating without canceling either one. This can be useful to reduce your chance of being seen while eating, especially during PvP, where a certain crit can be fatal, or when going afk for a few minutes while restoring health.
Hotfix (2012-09-12):Stealth has been made more effective.
Patch 4.1.0(2011-04-26): Base cooldown has been reduced to 6 seconds, down from 10, and the movement penalty from being in Stealth has been removed.
Patch 4.0.1(2010-10-12): Stealth is available at level 5.
Patch 3.3.0(2009-12-08): This ability no longer has multiple ranks. While active, the single rank of this ability (available at level 1) allows rogues to move at 70% movement speed.
Patch 2.3.0(2007-11-13): If you are in Stealth and try to use an ability that may not be used while stealthed, you will leave stealth and use that ability. This can be disabled with: /console autoUnshift 0