I think it's hard to figure out how much time passes in the play. It must be around three months, from what I can figure out.
We have limited periods of action:
First day: The ghost is walking on the ramparts, Laertes leaves for France, Hamlet meets the ghost. That happens within one 24-hour period. Hamlet tells us that it's not yet been two months since his father's funeral).
[time passes--at least there are hints that it does]
Second, maybe third, day: Claudius sends Rosencrantz and Guildenstern to spy on Hamlet; Polonius sends Reynaldo to spy on Laertes; Ophelia tells her father of Hamlet showing up "with his doublet unbraced;" Hamlet meets Rosencrantz and Guildenstern and the players; the players agree to do a play "tomorrow night"; Polonius becomes convinced that Hamlet is mad from love; Hamlet delivers his "to be or not to be" soliloquy and makes a huge scene with Ophelia; the play is delivered, during which Ophelia says it's been "twice two months" since King Hamlet died; Hamlet makes a huge scene with his mother and kills Polonius; Hamlet is sent to England. That happens (believe it or not) in about one 24-hour period (it could be longer--but not longer than 48 hours, because the play is delivered the next night).
[ time passes ]
Third, maybe fourth, day: Ophelia, who is out of her wits, confronts Gertrude; Laertes returns and threatens Claudius; Hamlet tells Horatio and Claudius that he is back; Claudius plots to kill Hamlet and Gertrude tells them of Ophelia's death.
This is a little murky. Does more than an afternoon pass between the scene with Ophelia and Laertes and Ophelia's death? It's quite hard to tell.
Fourth day?) Hamlet arrives at the graveyard and sees Ophelia being buried; he has a huge scene with Laertes.
Again, it's a little murky how much time passes, but:
Fifth day? ) Hamlet relates the story of the sea voyage; Osric interrupts them to tell Hamlet of the challenge; Hamlet fights Laertes and a lot of people die (six, in fact, if you count Rosencrantz and Guidenstern).
Probably, not a lot of time passes between Ophelia's funeral and the scene when Hamlet tells Horatio what happened on the voyage. This must have happen at the first opportunity, which could well have been the same day. But the ambassador from England shows up later that same day?
That means that it must have taken Hamlet a while at least to get back to Denmark with the pirates. Was he taking fencing lessons from them or something? =>;]
I also wonder why Horatio stuck around after Hamlet was sent to England?