There is a good summary and analysis here at enotes (link below), but this scene is essentially about explaining the past, and setting up a few important actions which will have bearing on the plot later.
In this scene we hear Claudius, who is now King of Denmark, and Prince Hamlet's paternal uncle (and now stepfather, too!) explain that he is grieved at the death of his brother the former king. We learn that Old Hamlet was Claudius' elder brother. In the Denmark of this time (this story was originally about Denmark in the thirteenth century, some four hundred years before Shakespeare staged this play) it was by no means certain that the son would always immediately follow the father into the kingship (royal primogeniture). In some countries, especially in Scandinavian ones, kingship passed to the next brother. But primogeniture was believed to be correct in Elizabethan times, so the throne being taken by Claudius after his brother's death already adds the tension of Claudius appearing to be a usurper. That Young Hamlet was, indeed, of only student's age, and away in Wittenberg at the time of his father's death, are arguments Claudius could make for him becoming king over his nephew. The important thing here is that Claudius is now on the throne, and has taken the extraordinary step of marrying his brother's widow (something which was strictly forbidden in England, and considered incestuous by Shakespeare's time). He thus appears in a very bad light -- he looks like a greedy usurper who coveted everything his brother had. This is all easily discerned by the audience from Claudius' first speech in this scene.
Then Laertes, a good friend of Hamlet, brother of Ophelia, and son of Polonius (and a chief courtier) asks leave to return to France to study. He is granted this, and thus one of Hamlet's good friends, a man of reason and principle, and one of the principal protectors of Ophelia is now gone from the Danish court. This is important, for if Laertes had stayed many of the subsequent plot twists (such as Ophelia's death) would probably not have occurred.
Hamlet is formally welcomed back to court, which gives him the chance to make some snide, and apt, asides ("A little more than kin and less than kind" line 67) and to show, in veiled speech, his dissatisfaction with the current state of affairs. Then Queen Gertrude shows herself to be, though probably a very foolish woman, still very concerned over the welfare of her son. She begs him to stop grieving for his father, and to stay in court and not go back to study in Wittenberg. This, too, is important, for probably none of the deaths (Polonius, Claudius, Ophelia, Hamlet, Gertrude, or Laertes) would have occurred if Hamlet had gone back to university. So the absence of Laertes and the presence of Hamlet are established in this scene, and they are necessary to the machinations of the plot. This all take place in a "room of state" in Castle Elsinore -- probably a throne room or audience hall of some sort.
Everyone leaves, and Hamlet begins his soliloquy in which he expresses his desire for suicide, and his various grievances against his mother and uncle. At the end of this scene, the night watch comes with Horatio to tell Hamlet that they have seen his father's ghost. That Hamlet decides to go and see the ghost has bearing on the plot -- it is this visitation which spurs him on to his "madness" and erratic actions.