At least two hours before dusk is when I'd stop and start setting up camp.
I know how long it takes to set up camp even when you have all the ideal gear like tent, sleeping bag, firewood, and lighter, and it takes a while. If I have to set up camp without that stuff then I'm going to want at least two hours to do so. I'd rather be relaxing by a fire, then wondering around in the dark, while I'm cold and tired. Or trying to finish setting up camp in the dark, while I'm cold and tired. That's when accidents happen. I'd much rather try and find my way out in the morning when I'm rested and fresh.
Besides, if you are supposed to be back before dark, and you aren't, most likely your significant other will have someone out there looking for you by midnight, and you are unlikely to have to even stay the entire night.
Unless of course I know were I'm at and know I can get out even in the dark, or if I know the perimeter of the woods I'm in is small and I can get out by just walking straight in any direction for a half hour.