There are a few issues that might cause some confusion.
An attacker with sneak attack qualifies when the target is denied his or her Dex bonus to AC. On the other hand, the attacker must also be able to see the target clearly to sneak attack.
This can make a sneak attack difficult when both the attacker and the target have the same type of vision. Natural light sources will have an area of shadowy illumination that will allow the rogue to hide, but if the target is also in the shadowy illumination, the rogue can't make a sneak attack.
If the target is inside bright illumination and the rogue is in the shadowy illumination, then a successful hide check will allow a sneak attack***.
If the rogue has superior vision to the target, this can allow sneak attacks. For example; a rogue with low-light vision can attempt to hide in what is bright light for the rogue, but is shadowy illumination for the target's normal vision (20-40' from a torch and the like).
***In 3.5, it was never explicitly stated until the Rules Compendium that if an attacker is hidden with respect to a target, that target treats the attacker as invisible, although it logically follows, even if not stated explicitly.
With Pathfinder, although they have changed a lot of the text, I could not find anywhere this was explicitly stated either. They do say a creature in darkness without darkvision is effectively blinded, but they do not explicitly state that while hidden, your target treats you as invisible. They did however, make this clarification on the forums.
"It was our intent that if you are unaware of a threat, you cannot react to a blow."
Also in the RC (which may have come from Comp Scoundrel) is moving between cover and sneaking up from hiding. These allow you to move from cover or concealment while still hidden (qualifying you for a sneak attack if successful).
Pathfinder also has a similar rule;
"if you leave cover or concealment, you may make an attack "unobserved" as long as you end your turn in cover or concealment."
The mechanic is slightly different (and does not suffer the penalties in 3.5), but the end result is the same.
What 3.5 also never came out and said explicitly is the -20 penalty from attacking applies after you attack. That's how I've always ruled/understood it, but Pathfinder actually added that to the entry.
"Your Stealth immediately ends after you make an attack roll"