Hamlet's constant brooding about death and humanity comes to a head (grotesque pun intended) in the infamous graveyard scene, where Hamlet holds up the unearthed skull of Yorick, a court jester Hamlet knew and loved as a young boy. The skull itself is a physical reminder of the finality of death. For all of Hamlet's brooding and philosophical contemplation of mortality, here, Hamlet literally looks death directly in the face.
We're also interested in the way this moment with the skull marks a turning point for Hamlet. It's here, in the graveyard, where Hamlet thinks about the commonness of death and the vanity of life. He not only remembers Yorick, a mere jester, but also considers what's become of the body that belonged to Alexander the Great. Both men, concludes Hamlet, meet the same end and "returneth into dust" (5.1.30). This seems like a new, more mature acceptance of a common human fate. (Notice that Hamlet is contemplative but not suicidal or anguished when he speaks these lines.)
Aside from seeming to "grow up" in the graveyard, some literary critics also suggest that Hamlet literally ages in this scene. Here's how the argument works: when the play begins, Hamlet is a university student, which means he's pretty young. By the time Hamlet makes it to the graveyard in Act V, Hamlet appears to be thirty years old (much older than the average university student). The evidence? The First Clown says he's been a gravedigger in Elsinore since "the very day that young Hamlet was born" (5.1.28) and a few lines later he reveals that he's been a "sexton" in Denmark for "thirty years" (5.2.30). If you want to argue that Shakespeare just messed things up, feel free (Shakespeare has been known to make a mistake or two). But it's not so surprising to us that Hamlet literally ages between Act I and Act V – perhaps it's a reflection of his new, more mature outlook on life and death.
Finally, we also want to note the way the graveyard is different from the royal court (aside from the dirt and bones and all). Recall from Act I that the court is a place where Hamlet's told to stifle his grief, to forget his dead father, and to move on (1.2.6). The graveyard is a space, then, where Hamlet is allowed to remember the dead.
"Alas, poor Yorick," says Hamlet, as he recalls that Yorick was "a fellow of infinite jest, of most excellent fancy," one who "hath borne [Hamlet] on his back a thousand times" (5.1.26). Hmm. That’s quite a coincidence, no? Hamlet encounters the skull of a man who worked for his father and who Hamlet knew as a child. This causes Hamlet to remember his childhood as a happy time in which Old Hamlet was alive and all was well in the world. All this happiness, of course, is disrupted when Hamlet realizes Ophelia (now dead) is being buried a few gravestones over. We'll let you handle that one on your own.