Yes and no. Hamlet does succeed in killing his uncle and stepfather, Claudius, the man who murdered his father and married his mother fewer than two months after the funeral. In the final scene of the play, after Hamlet is mortally wounded by Laertes's poisoned rapier and Gertrude falls, poisoned by the wine Claudius prepared for Hamlet, Hamlet does mortally wound Claudius with the poisoned rapier and force him to drink the wine. The king dies soon after. So, in that sense, Hamlet does "set it right" in that he's exacted revenge on his father's brother and murderer, the king.
However, Hamlet loses his own life in the process. Further, many other people who are innocent of the murder of old King Hamlet lose their lives before Hamlet successfully exacts revenge on his uncle: Polonius, Ophelia, Rosencrantz and Guildenstern, Gertrude, and Laertes all die while Hamlet is still figuring out how to avenge his father's murder. On one hand, Hamlet is eventually successful in eliminating the corruption at the heart of Denmark; on the other hand, he had to die to do it. So, one could argue that he does, in the end, set it right, but one could also argue that he fails to do so when he loses his own life in the process.