It really is up to you.
I personally prefer to spend half an hour to an hour at least trying to figure it on my own, since as a side effect I usually learn quite a lot more than just the solution to my problem.
However, if you are in a tight schedule and have a deadline looming over you, do a quick search on SO and ask right away if you don't find anything.