The answer to this question can be found in Act V, Scene 1. This is the scene where the grave diggers are digging a grave for Ophelia. It is the one where Hamlet gives his "Alas, poor Yorick..." speech.
In that scene, we find out that the one grave digger has been sexton for thirty years. We find that out because he directly tells Hamlet that he has been in the job that long. He says that he started the job in the year that Hamlet (the king) "overcame" Fortinbras, the King of Norway. It was also on the exact day that Hamlet himself was born.