In Act 2, Scene 2, Macbeth has killed Duncan. Macbeth begins to feel anxious and nervous about the murder. He and Lady Macbeth are startled by every little noise, including a knocking on the door. Each noise startles them as if the noise itself is an accusation and condemnation.
To know my deed, 'twere best not know myself. Knock.
Wake Duncan with thy knocking! I would
thou couldst! (II.ii.92-94)
The porter's appearance in Act 2, Scene 3 provides comic relief. He jokes that he's guarding the gates of Hell. However, if there is anything that continues or augments the suspense, it is the continuous knocking. It is the knocking that represents, for Macbeth and Lady Macbeth in Act 2, Scene 2, the sound of guilt.
In Act 2, Scene 3, the porter supposes the person knocking could be a sinner of some kind. One supposition is that the one knocking (on the gates of Hell) is a liar who committed treason.
here's an equivocator that could swear in both the scales
against either scale, who committed treason enough for God's
sake, yet could not equivocate to heaven. (II.iii.7-10)
This is clearly a reference to Macbeth who did commit treason by killing Duncan. Ironically, those knocking are Macduff and Lennox, who end up being major players in Macbeth's downfall. But back to the point of the question, if there is one thing that contributes to the suspense, it is the knocking which, albeit comically, echoes the knocking that unnerves Macbeth and Lady Macbeth in the previous scene.