The range at which you will be detected depends on:
Your stealth skill level
Your opponent’s stealth detection level (really the difference between #2 and #1)
The distance between you
Whether or not you are in a 180º arc in front of the other player (increased chance when you are in front of the player vs. behind them)
Your Stealth skill depends on your player level (i.e. 300 skill at level 60, like other skills in the game) but can also be increased by Master of Deception talent and can also be increased by certain gear, +stealth enchant on cloak, and is increased passively by the nelf racial.
Your opponent’s stealth detection skill depends on their player level (also 300 skill points at level 60) and can also be increased by certain pieces of gear (catseye ultra goggles) and consumables (catseye elixir) as well as a felhunter’s paranoia buff or the human racial ability perception.
There is some helpful information about it at shadowpanther dot net (I’d post the link but the forums won’t let me)