What does "time is out of joint" mean to Hamlet?
In act one, scene five, Hamlet speaks to this father's ghost, which tells him that Claudius murdered him in the orchard by pouring poison into his ear. The Ghost then instructs Hamlet to avenge his death by murdering Claudius while sparing the queen. When the Ghost leaves, Hamlet meets up with Horatio and Marcellus but does not reveal the details of his conversation with the Ghost. After Hamlet makes his friends swear that they will keep the events a secret and informs them that he will be acting strangely in the upcoming days, Hamlet comments,
The time is out of joint. O cursèd spite, That ever I was born to set it right!
Hamlet is essentially commenting on the current state of affairs in Denmark, which are out of order. He uses the metaphor of a dislocated shoulder to represent Denmark's confused politics. The metaphor is also applied to time, which is mixed up as well. Hamlet recognizes that time is not right, and neither is the world as he knew it or Denmark's confused political hierarchy. He goes on to lament the fact that it is his responsibility to fix the current situation in Denmark at his father's request.
As Horatio explains to the castle guards after he sees the ghost, sightings of ghosts and other supernatural beings are ill omens that indicate that all is not well in the land. Horatio goes on the outline how ghosts rose from the grave in Rome before the assassination of Julius Caesar. The appearance of this ghost, along with the unsettling war preparations, show that this is a bleak and frightening time in Denmark.
Hamlet expresses the same sentiment after he has his conversation with his father's ghost by saying that "time is out of joint." The murder of a king or ruler upsets the order of the cosmos. Hamlet acknowledges the problem, but mourns the fact that he is the one expected to fix it by avenging his father's death. Thus the play opens with an eery, unsettled feeling.
When Hamlet says that "The time is out of joint," he is lamenting the fact that he is alive during this tumultuous and upsetting time. His father has been murdered and has gone to Purgatory, and his uncle is the murderer. Further, his uncle has married his sister-in-law (Hamlet's mother, Gertrude) in a what amounts to an incestuous relationship, according to the Bible. The wedding took place within two months of his father's death, and his father's ghost has returned and charged him with avenging the murder.
Overall, it is certainly an odd and overwhelmingly negative time in Hamlet's life—as well as being horribly disruptive to the country's well-being. Hamlet is feeling the heavy weight of responsibility to "set [things] right," and so in this quotation, he curses the fact that he is the party now responsible for doing so.
Hamlet says "time is out of joint" in Act I, scene 5, expressing his idea that his world is not sane and that things are not as they should be. In this scene, the ghost of King Hamlet asks Hamlet to avenge his murder by killing Claudius but leaving Gertrude, Hamlet's mother, alone. Hamlet says earlier in the scene, "There are more things in heaven and earth, Horatio, / Than are dreamt of in your philosophy" (I.5.169-170). In other words, the news that his own uncle has killed his father has made Hamlet realize that the world is a big and confusing place, as he tells Horatio, far more complicated than Hamlet had earlier imagined. He is in a state of shock.
At the end of the scene, Hamlet says, "The time is out of joint. O cursèd spite, / That ever I was born to set it right!" (I.5.190-191). Again, this means that Hamlet knows now that his world is not right. If time is not right, then nothing in the world is working correctly. He curses the ghost that came to him to tell him the truth about his father's murder, and he rues that he has to make the situation "right," meaning that he has to murder Claudius to avenge his father's murder.
It means that things have gone all wrong in the Kingdom, and he is lamenting the fact that it has fallen to him and his destiny to put it right-- which is what the Ghost basically asks him to do.