Well, it's a little hard some times to make an approach, but it's more easy when more time you are in the project.
But for me, depend of the complexity and my experience with other similar task i can make a assessment of the total time of the task/project.
It's important to know if there is something new to you, something you know or if you resolved some similar task in the future, and know the advantages and disadvantages of that task.
It hard to make a exact appreciation of the total time, but when more task or issues in a project you do, more idea have on how many time take to resolve some task.