Think back to similar tasks you've done in the past and how long they took you.
If you've done nothing similar at all before, try to break the task down into subtasks, then each subtask down further, until no subtask is left that sounds like it will take longer than 1-2 days to prototype in the most naive possible way; if you can't divide up a task with an estimate of longer than 3 days, this usually implies that you don't really know what is involved in doing that task; do some quick research. Once everything is broken up enough, total it up, double the result and give that as your estimate.
If you don't know how to approach a problem enough to do the above, and your boss is breathing down your neck so you don't feel you can research there and then, instead try to give your boss an estimate of how long it will take you to do the research required to understand the problem enough to give him a proper estimate.