Pearly gates

When do people who die enter heaven: when the soul leaves the body or at the "pearly gates"?

The Bible tells us that judgment takes place at a person’s death (Hebrews 9:27). At death, the body and soul separate. At death, the soul of a Christian enters the presence of God in heaven. That is why Jesus could assure the penitent thief that he would be with him in heaven that very day (Luke 23:43).

The “pearly gates” is a reference to Revelation 21:21. The imagery there is of the lavish love of God as seen in the new heaven and the new earth. The language is symbolic and not meant to be taken literally.