Priam is not a character in the play. He was King Priam of Troy an important character in Homer's Iliad and Virgil's Aeneid. In Act 2, Scene 2, Hamlet asks one of the players, designated as First Player, to recite part of a speech from a play which Hamlet says he heard the player recite once at some earlier time. The First Player naturally accommodates his host the Prince by reciting a large portion of the speech in question. It has to do with the fall of Troy after the Greeks managed to obtain entry to the great walled city by using the famous Trojan horse. One of the Greek warriors hidden inside the wooden horse was Pyrrhus, who was a son of the now deceased warrior Achilles. Hamlet says that the speech
'Twas Aeneas' tale to Dido, and thereabout of it especially where he speaks of Priam's slaughter.
Hamlet himself speaks the first lines in order to prompt the First Player.
The rugged Pyrrhus, he whose sable arms,
Black as his purpose, did the night resemble
When he lay couched in th' ominous horse,
Hath now this dread and black complexion smeared
With heraldry more dismal.
Hamlet's recitation ends with the words:
...the hellish Pyrrhus
Old grandsire Priam seeks.
So proceed you.
The First Player continues with a long recitation beginning with:
Anon he finds him,
Striking too short at Greeks. His antique sword,
Rebellious to his arm, lies where it falls.
Eventually, after describing how Pyrrhus kills Priam, the First Player also describes Priam's wife Queen Hecuba running barefoot up and down with her body covered only by a blanket. The part about Hecuba moves Hamlet to tears, and Polonius tells the First Player:
Prithee, no more.
Hecuba was eventually taken into slavery along with all the surviving Greek women. This is recorded in the Greek play The Trojan Women (415 BC) by Euripides. Priam figures most importantly in Homer's Iliad where he goes to Achilles' tent to beg for the return of his son Hector's body.
The Greeks slaughtered all the males in Troy when they managed to gain entrance with their wooden horse. They even slaughtered all the male infants, including Hector's baby. King Priam died at the hands of Pyrrhus on this famous night which ended the long Trojan War. Aeneas was one of the few men who managed to escape from the burning city and later was reputed to have established the city of Rome.