Manager: We (meaning you) need to do task A. How long will it take?
Me: Task A will take X days to do.
Manager: That seems awful long.
Me: How long do you think it should take?
Manager: It surely could not take any longer than Y days.
Me: Ok, it seems you have an answer to your question then.
Later:
Manager: It’s been Y days, why isn’t task A done yet?


Read Software Estimation by Steve McConnell and recommend it to your manager:
The person doing the work the one best suited to estimate it.
Also, start tracking estimated vs budgeted time in some searchable system.
Next time this comes up, look up how long it actually took to complete a similar task instead of thoughts and prayers.
If boss won’t track historical budget vs actual, track it yourself.
The way we estimate on my team is to break tasks down into related subtasks that will take one day or less, then add up all the subtasks. It’s worked pretty well.
As a manager in found this to be partially false.
Most persons doing the work quote forget that shit happens. Except for the few reliable persons I supervised, I usually always asked the follow-up question: what “unforeseen crap” time did you include, and made sure to leave with 3 values: all goes well (which I kept to myself), usual estimate, what if bad shit happens. Then I’d just use the standard pert guesstimate for my official schedules, making sure to include normal dead time which employees often forget (e.g. 8 days work is really 2 full weeks when accounting for meetings).