There is an interesting set of lines that build on the idea of "heart." Hamlet orders his mother
"Look here upon this picture and on this, -
The counterfeit presentment of two brothers. . .
This was your husband. - Look you now what follows:
Here is your husband, like a mildew'd ear
Blasting his wholesome brother." (III.4)
It has been suggested that the "picture" to which Hamlet refers is a heart-shaped locket around Gertrude's throat, with the old King Hamlet on one half, and Claudius on the other. Each half of the locket resembles an ear; hence Hamlet's simile. Gertrude's cry, "Thou hast cleft my heart in twain" may be seen as a continuation of this same metaphor, particularly when Hamlet suggests, "O, throw away the worser part of it" (i.e. the Clausius half of the twin portraits).
Hamlet has forced his mother to listen to him, and has, with his words, held a mirror up to her so that she will acknowledge what she has done in marrying her dead husband's brother. He refuses to let her be until he has offered her a glimpse of her soul, "a glass/ where you may see the innermost part of you". He forces her to acknowledge that she has no good (virtuous/ respectable) reason for her marriage, and in doing this, makes her realize her guilt. She says, "thou turnest mine eyes into my very soul; and there I see such black and grained spots/ As will not leave their tinct." She says he has made her look deep into her soul and what she sees there is black, permanently stained. This suggests that instead of virtue in her soul, she sees vice.
He tells her that she must repent and leave her new husband. This is when she says he has cleft her heart in twain. This timing is significant because we wonder what it is that makes her so devastated--is it her guilt at what she's done, or her desire to continue her relations with her new husband that makes her feel this way?
By this she literally means that her heart is cut in two. But it is unclear as to where the two parts are. Is it between love for her first husband (by all accounts the better man) and her second? Is it between right and wrong? Or is her heart not divided, but rather broken, and she is heartbroken because she feels so guilty? Hamlet speaks of virtue and tells her to throw away the "worser part" of her heart and life "the purer with the other half," suggesting, perhaps naively, that she has hope for some redemption now that he has saved her.
I think you may be referring to Act III, scene 4 where Hamlet kills Polonius, thinking he is Claudius. Hamlet tells his mother what he thinks of her marriage to Claudius. After his tirade, Gertrude begs him to stop. In this line, she's telling Hamlet he has broken (cleft) her heart in two (twain)pieces,
Gertrude means,”Thou hast cleft my heart in
“You have broken my heart by criticism”
In this tragedy, such words of Gretrude reveal her in dilemma. Hamlet shows her about the Ghost, invisible to her.it was her great sin that she married with his husbands brother speedly and believed in that venomous snake. She is told all truth and he points to the Ghost. Hamlet emphasizes her to confess and repent. She usually takes sides with Claudius and for her protect, she shows anger her son and cries. When it is revealed that Claudius is the killer then what she has to do. Hamlet condemns her to be sinner .Her heart breaks by such condemnation. Now she goes into seclusion, because her previous husband loved too much spiritually, but the new one is greedy and dishonest. He had hunger for the throne and succeeded. When she realizes all the things and comes out of such fog, she feels her fault and her heart crushes. It seems that she is not polluting but frailty thou the name of woman. Here she is under the heavy burden of criticism because her blood accuses her. She comes to round that she has lost all. The words of Ghost disclosing the truth, also is confirmation as the condemnation to her.