If you think the task you have been given is going to take more than 2 hours, stop work, call the client and confirm they'd like you to keep going on that task. Sometimes the client will say keep going; sometimes they will say thanks for checking with them and ask you to work on something else.
If you can, don't wait until two hours is up before checking - check as soon as you realise it is likely to take more than two hours.

Figure: bad example: Don't keep working on a task until it's too late!

Figure: Good example: Calling the customer to tell them that "changing that function hyperlink is going to take more than 2 hours. Actually more like 2 days, do you want me to go ahead?"