The only way to figure that out is through experience. You make your best guess and then learn from experience how good your guesses are and adjust as necessary.
Joel Spolsky has a product called "FogBugz" that started out as just a bug tracking tool but has morphed into much more. One of the more interesting things is that you can enter estimations of how long you think tasks will take, then as you figure out how long they actually take, there are tools that tell you how well you or your team are estimating. If you can list most of the tasks ahead of time, FogBugz can tell you a reasonable ship-date based on the estimated times and your past history. I've never tried it for single-developer use, but when I asked Joel about it, he said that there are some people trying it.
In any case, FogBugz has some interesting ideas to borrow from for estimating time.