The idea that there are pearly gates in heaven comes from the Bible, but the biblical description is not usually what is meant in the popular understanding of heaven's pearly gates.
Does heaven have pearly gates?
In cartoons and other depictions of people entering heaven, often shown is one gate at which people are either given or denied access to heaven. This is not the biblical depiction of pearly gates.
The apostle John was given a view of the New Jerusalem and wrote this: "And the twelve gates were twelve pearls, each of the gates made of a single pearl, and the street of the city was pure gold, like transparent glass" (Revelation 21:21).
The New Jerusalem, where these gates are, will descend from heaven (Revelation 21:2); it is part of the new earth (Revelation 21:21). The gates are around the city, not an entrance to heaven. Also, John describes a dozen gates, not just one, though each gate is made out of one pearl.
Additionally, the gates to this city are constantly open (Revelation 21:22–25) yet only the redeemed will cross through these gates into the city. "But nothing unclean will ever enter it, nor anyone who does what is detestable or false, but only those who are written in the Lamb's book of life" (Revelation 21:27).
This wonderful place is inviting, and certainly the pearly gates will be dazzling. But no detestable or false person will be allowed to enter. Yet all of us have done bad things; on our own, we're all banned. So, how does a person gain admittance? To be written into the Lamb's book of life, a person must be forgiven by Jesus Christ and covered by His sacrificial blood. "Blessed is the one whose transgression is forgiven, whose sin is covered. Blessed is the man against whom the LORD counts no iniquity, and in whose spirit there is no deceit" (Psalm 32:1–2). It is by the blood of Jesus that we become clean. By God's grace, through faith in Jesus Christ, we can be saved (Ephesians 2:8–9; Acts 4:12; Romans 10:9). John 1:12 tells us those who are in Christ are children of God and 1 Peter 1:4 says they will receive an eternal inheritance.
Will heaven have literal streets of gold?
What does the Bible say about the new heavens and the new earth?
What does the Bible say about the New Jerusalem?
Why will there be walls around the New Jerusalem?
How can I be sure that when I die I will go to heaven?
Truth about Eternity