The brain is only capable of a few hours of difficult work per day. For most people, research showsthat limit hovers around 4 hours per day.
Anecdotal evidence bears that out. Famous minds like Charles Darwin, Thomas Jefferson, and Virginia Woolf all practiced some version of the 4-hour limit on mental load.
Personally, I like to dedicate 3–4 hours per day to the really tricky tasks. As a software developer, that means a few hours per day working on my most important, thorniest task.
After the 4 hours, your brain produces diminishing returns. Plus, rest is important. So, it's in your best interest to stop!
Once you realize you only have 4 hours, it's both freeing & focusing. Working overtime won't help. What will help? Focusing & spending your 4 hours wisely.