Ah, this is a subject which can be interpreted several different ways. See the first link below for some answers to a very similar question.
There several ways of looking at this, but two of the most immediate are a) what does Hamletsay about why he doesn't kill Claudius ?...
and b) what do we, as the audience (or readers) of the playthink about why Hamlet doesn't kill him? Neither of these may definitively answer the question, but it's a good place to start our exploration of why Hamlet doesn't take this very easy opportunity to kill his hated stepfather.
Let's first explore what Hamlet says about it (because, in true Shakespearean fashion, most or all of a character's emotions and motivations are displayed to the audience by the device of soliloquy, which is really just the character talking to himself.) This is Act III, scene 3.
Now might I do it pat, now he is praying; And now I'll do't. And so he goes to heaven, And so am I revenged. That would be scann'd. A villain kills my father; and for that, I, his sole son, do this same villain send To heaven.(80)
...No. Up, sword, and know thou a more horrid hent.(90) When he is drunk asleep; or in his rage; Or in the incestuous pleasure of his bed; At game, a-swearing, or about some act That has no relish of salvation in't Then trip him, that his heels may kick at heaven,(95) And that his soul may be as damn'd and black As hell, whereto it goes.
What's young Hamlet saying here? He's saying that he could do it "pat" (easily) -- kill his stepfather easily, without too much risk to himself. But he doesn't -- and the reason he says that he doesn't is that this would be "hire and salary" (III.iii.81) (in other words, he'd be doing Claudius a favor by sending him to heaven when his soul was clean, and therefore enabling this murderer to go to heaven). Hamlet says that he wants to "take" (86) Claudius when he is sinning, and then he enumerates those sins. This would mean, according to Hamlet's Catholic beliefs, that Claudius would go to hell, or at least purgatory, for his unforgiven sins. Hamlet has this foremost in his mind because he has just seen the ghost of his father, who has told him that he is in purgatory (Act I, Scene iv). Of course, the vengeful son would want at least as bad an afterlife for his father's murderer as for his own father. This is a neat, doctrinally sound excuse for not killing Claudius -- if you overlook the fact that Christian doctrine expressly forbids killing! So Hamlet is splitting hairs here -- and we think that he knows it.
So, the audience/reader is left to think of why Hamlet might not be motivated, at that moment, to kill Claudius. One might be for his own safety; he might be afraid of Claudius's friends (not to mention his own mother's, Claudius's wife) reprisals. Perhaps he shrinks from killing a king because people might accuse him of the same thing that Claudius did: of killing a sitting king in order to inherit his throne for himself! This would certainly give any honest, moral person pause, especially when the murdered person was his own father. Or, perhaps, we are meant to think that Hamlet is truly a good person, and is only driven towards murder because of circumstances, not because of his nature. These are all valid interpretations, and there are many others.