The correct answer is: you don’t know.
Unless you are a basketball player, odds are you don’t know how high you can jump.
Why is then that every time your manager or client ask you: “how long do you think this is going take?”, you always have an answer: “Less than an hour,” “a couple of days,” “maybe a month.”
Again, unless you are a certified PMP, chances are you don’t know how long something will take. Once you’ve set an expectation about a timeline, it will stick in your stakeholder’s mind until you ship.
Of course, it is hard to reply with: “I don’t know,” after all, you are being paid to know. You are the one who knows.
When you are estimating something, you are thinking in raw hours: non-stop, without distractions, 100% focused on the task you know you can do (because you’ve done it before.)
The problem with this intuition-based approach is there will be distractions, you might need to take a break, and 100% focused on one task, for how long you’ve estimated (even for an hour), it is tough to achieve.
How should you respond when someone asks you how long something would take? The best you can do is to reply with facts: “The last time I did this, it took me this much.” Or, “in our last project, with these three developers, it took this much for something like this.”
That’s the most honest answer you have at this point.