Opinions on the reasons for what can be described as Hamlet's procrastination differ. On the one hand, it can be argued that the title character is not exactly decisive, that he is more inclined toward thought than action. Throughout the play, the events surrounding him in Elsinore lead him to philosophical musings on life, morality, death, and other fundamental aspects of human existence rather than spurring him to precipitous action.
It could also be argued that Hamlet, paralyzed by melancholy, is unable to steel himself to action against his uncle/stepfather. Indeed, he himself reproaches himself for a lack of will (as well as the penchant for philosophy mentioned above) when he compares himself to young Fortinbras, leading a Norwegian army against Poland:
...I do not know
Why yet I live to say 'This thing's to do,'
Sith I have cause, and will, and strength, and means To do't.
Another reason is, of course, that Hamlet needs to ascertain whether the ghost of King Hamlet spoke the truth in accusing Claudius of his murder. This is what he meant when he said that he was staging the play "to catch the conscience of the King": by watching Claudius's reaction to events so similar to those described by the Ghost, he could determine once and for all whether the new King was guilty of the murder of the old.