What does Hamlet realize after talking to the Ghost in Hamlet?
Hamlet realizes three things after his meeting with the Ghost in Act I.
First, his belief that Claudius has ascended to the throne though foul play has been confirmed. That gives Hamlet the courage to pursue his vengeance against and murder of the King (an unpardonable sin in the Elizabethan Church).
Second, Hamlet gathers the information he needs to set his course of action--to act mad in the hopes, apparently, of catching the King napping (pardon the pun).
Third, the information given by the Ghost causes Hamlet to resent his mother despite the Ghost's request to let her conscience deal with her. This emotion is the impetus for Hamlet's behavior toward both Gertrude and Ophelia for the rest of the play.
Without this Hamlet-Ghost meeting, Hamlet would have wallowed in his grief and would never have taken any action.
He realises... "time is out of joint. Oh cursed spite. that ever I was born to set it right."
In other words... he realises that 'reality' is false. His uncle is not the true inheritor of the throne (or his mother) and that there has been 'dirty work at the crossroads'.
History has been stolen by his uncle. The new king is not the king, he is a thief. And it is his (Hamlet's) responsiblity to avenge his father's death and remove the imposter from the danish throne.