Most of us are terrible at estimating how long tasks will take. Previous research has shown that we underestimate how long it will take us to do large tasks, but overestimate how long it will take us to do small tasks.
Newer studies suggest that it's the opposite if you estimate how much you can achieve in a given time period. In other words, if someone asks us how much we can achieve in 90 days, we will tend to overestimate; if they ask us how much we can achieve in 90 minutes, we will underestimate.
To come up with a more accurate estimate you can combine the two.
Let's say you want to figure out how long it will take you to write a chapter of a book, which includes doing research, outlining the chapter, and writing a first draft. That's a fairly large task. First you could estimate how long you think that would take. Perhaps you would say 20 hours. Typically that would be an underestimation--most likely it will take longer.
Next. start with 40 hours as the given. Think about how much research, outlining and writing you could get done in that time. Then think about the amount you need to do for your chapter. You might conclude it would take 40 hours. Typically that would be an overestimation--most likely it will take less time.
It's likely that the actual time required will be somewhere inbetween, perhaps 30 hours.
You can test this method yourself; if it works for you, use it when setting time targets for getting things done.
(There are many useful time and self-management strategies in my book, Focus: Use the Power of Targeted Thinking to Get More Done. It's published by Pearson and you can get it from Amazon or your other favorite bookseller.)