After Hamlet mistakenly kills Polonius, he continues his rant against Gertrude. She keeps asking him to stop. Hamlet’s father, the Ghost, enters and speaks to Hamlet. Hamlet replies and Gertrude asks:
Alas, how is’t with you,
That you do bend your eye on vacancy
And with the incorporal air do hold discourse?
Again, Hamlet asks if she can see the Ghost. She cannot and the Ghost exits. At this point, she must think Hamlet is mad. But then Hamlet tells Gertrude that he is not mad (crazy). He is distraught by her and Claudius’ crime and this is why he speaks to the air (Ghost). He asks here to confess her sins and avoid getting into bed with Claudius. Hamlet then asks Gertrude to convince the king that he is mad. This is to prevent Claudius from supposing any plot of revenge.
I don’t think we can be sure about whether Gertrude thinks Hamlet is mad or not at this point. She saw him speak to the “incorporal air,” but he told her he was not mad. Later, Gertrude does what Hamlet asks and tells Claudius that Hamlet is mad. Since she goes along with this, we can assume that it is more likely that, by the end of this scene, Gertrude does not think Hamlet is mad.
Gertrude is a difficult character. It is never clear how much, if at all, she was involved with Claudius' plot in killing the king.