My answer is in two parts.
When to ask other grad students or other researchers for help?
The answer is, anytime. There is nothing to be afraid of asking questions to your office mates, researchers across the doorway or even online. However, they may or may not be able to offer much help because they may not know exactly what you're working on.
When to ask your advisor for help?
The answer is, when you're ready to ask meaningful questions. You don't want your advisor to say why didn't you ask for help sooner. Nor you wanted him to accuse you not working hard enough. If you have meaningful questions and you're stuck for a while - how long is that "a while" usually is a few weeks(long enough to be considered long), you should approach him/her and say you're stuck. Your advisor is there to answer your questions. That's what an advisor is. If you already spend a few weeks on a problem, he would be glad to help you.
You gain more understanding of your research when you try to figure out how to ask questions which make sense because you have to organize your thoughts before asking. Then you're closer to the bottom of it.
However, if you really want to figure it out by yourself for some reasons, you can consider giving yourself a few months. In this case, you would at least let your advisor know you're onto something so that he knows you're making progress. Don't forget he is your advisor. He is on your side !