The mythology of seven heavens is ancient — at least as old as ancient Babylonia. Originally, the number may have been taken from the celestial bodies that are nearest to earth, including those planets visible to the naked eye: the moon, Mercury, Venus, Mars, the Sun, Jupiter, and Saturn. In later mythologies, the heavens seem to represent different levels of paradise for those humans who have reached ever-increasing levels of piety. The idea of there being seven heavens is not universal, of course; the Maori have between two and fourteen heavens; Polynesians have nine. And some cultures that started with seven later expanded.
Ancient Babylon's Seven Heavens
It's believed that, unlike the flat earths in many creation myths, in Babylonian mythology the earth is a hollow half-sphere, much like a bowl — or a kufa boat — sitting upside down. Above it is the "lower firmament" or atmosphere. Then the realm of the planets, also called "sheep," "wanderers," or "watchers," as well as lightning and thunder. The wanderers also have corresponding rulers:
The Moon: Sin (AKA: Nanna, Su'en)
Mercury: Nabu (Nebo of Isaiah 46:1)
Venus: Ishtar (AKA: Astarte, Aphrodite, Artemis, Asherah of 1 Samuel 31:10)
Mars: Nergal (2 Kings 17:30)
The Sun: Shamash (AKA: Samas)
Jupiter: Marduk (patron deity of the city of Babylon, see Jeremiah 50:2)
Saturn: Ninib (possibly Nimrod of Genesis 10:8-9)
Bear in mind that concepts of the gods changed quite a bit depending on the era, region, and local worship customs. For instance, sometimes Nergal is associated with a certain aspect of the Sun. These seven gods were given authority to decree fate. Above their planets dwells the spirit of the heavens. Even farther out is the "Great Celestial Ocean" which is the home of the Zodiac. Finally, the "Great Chaotic Crystalline Sea" envelops everything.
Under the hemisphere of the surface of the earth are mirror images of the seven wanderers, representing the underworld where ghosts and the king of the dead reside. These lower realms are where people go when they die. There's no indication dead humans were meant to ascend to the heavens.
Hindu's Seven Heavens
The Hindu text the Puranas also teach that there are seven higher worlds (vyahrtis or heavens) and seven lower worlds. Unlike Babylonian mythology, all the worlds are meant for humans after death. Upon death, the god of death, Yama, accounts a person's life and determines how long they will stay in which of the higher and lower worlds in accordance with the karma earned during their most recent incarnation. When the requisite stays have been accomplished, the soul is reincarnated on earth. The Hindu heavens are:
Satyaloka: the abode of Brahma (he may live above Satyaloka) and the greatest sages
Tapaloka: the place of the second-greatest sages in recognition of their faultless observance of the rituals
Janaloka: the world for the life-long celibates
Maharloka: the place for those who voluntarily went through a period of celibacy
Svarloka: a group of planets that are home to lesser deities, bards, and other pious beings
Bhuvarloka: the atmosphere of the earth; home to ghosts and spirits caught in limbo before their rebirth
Bhurloka: the earth and other planets with similar attributes; the only place people can accumulate good or bad karma
Some believe a person could spend time in both a heaven and a hell — for instance, if a lifelong celibate did some evil they needed to work off. If enough good karma is earned, the soul can finally break out of the cycle and reach Nirvana.
Judaism's Seven Heavens
The Hebrew word for heaven, shamayim, is only ever plural. Different traditions have different numbers of heavens; the Jewish mystical text, the Zohar, claims there are 390 heavens and 70,000 worlds. As science progresses, the understanding of the seven heavens is becoming less literal and more allegorical, as a description of how God interacts with His creation.
Mystical Judaism says followers can make their way through the heavens if they pass certain tests and know the names of the guardian angels. At each level, the mystic is allowed to receive particular wisdom. Some Jewish scholars say Paul's trip to the "third heaven" is an example (2 Corinthians 12:2-4). Legend says when Moses went to Mt. Sinai, God opened up all the heavens and let the Israelites see in (Exodus 19:10-11).
The characteristics of the seven heavens vary with source and have been discussed by the Rabbis of the Talmud for ages. The apocryphal book 2 Enoch (written, perhaps, shortly before the fall of the Temple in AD 70) gives a great amount of detail. But the book can't be a true account, since it was written nearly 4000 years after the biblical Enoch was taken by God. The story may have been adapted from Zoroastrianism.
Originally, 2 Enoch mentioned seven heavens; it was later changed to ten, possibly by the Eastern Orthodox Church in the 7th Century. What each of the heavens contain or represent vary depending with the teller. The story claims that Enoch walked the heavens with the angels, returned to earth and told his family, then was taken to heaven again (Genesis 5:24). The heavens he visited were:
Vilon ("curtain"): a curtain which is rolled over the earth at nighttime to block the sun (Isaiah 40:22); contains the atmosphere, minor stars, snow and dew; abode of Adam and Eve; governed by Gabriel; called curtain or veil because it veils or hides the other six levels; represented by the moon
Raqi'a/Raki'a ("expanse," "canopy"): possibly refers to the frozen canopy over the earth before the Flood (Genesis 1:7-8; Deuteronomy 11:11); Moses visited Paradise here to receive the Ten Commandments; fallen angels are imprisoned here for marrying human women (Genesis 6:4); dwelling place of souls awaiting judgment including "men of renown," apostates, tyrants; called expanse because it's where the sun and planets dwell (Genesis 1:14, 17); represented by Mercury
Shehaquim/Shehaqim/Shehakim ("clouds"): Eden and Tree of Life, the mill that produces manna; also includes paradise and hell/hades (Psalm 78:23-24); represented by Venus
Zebul ("habitation"): stratosphere, sun, moon, and "four great stars," including celestial mechanics; dwelling of the winds; called habitation because it's where the New Jerusalem with its temple is (Isaiah 63:15); represented by the sun
Ma'on ("refuge"): home to "Grigori" — fallen angels who mourn for their brothers in Raqi'a; hell/Gehenna; Michael or possibly Samael presides; filled with ministering angels who sing by night; called refuge because it's where most of the angels reside; represented by Mars
Makhon/Machon/Makon ("city," "established place"): home for angels in charge of nature's cycles and good governing systems of the world; angels who write men's actions in books; governed by Samael, a dark servant of God; storage place of rain, snow, and hail (Deuteronomy 28:12); called city because it's where the City of Angels resides; represented by Jupiter
Araboth/Aravot ("deserts"): also known as the 10th heaven; Throne of Glory and God dwell here as well as unborn human souls, Seraphim, Cherubim, justice, righteousness, souls of the righteous, and ineffable light (Psalm 68:5); called desert because it has no moisture and no air; God also said to be above the seventh heaven; represented by Saturn
It's possible that Judaism's belief in multiple heavens could have been influenced by Zoroastrianism, but it's unclear how Zoroastrianism influenced Judaism — or if it was the other way around. Jews taken to Babylon in exile who did not return to Jerusalem would have been exposed to Zoroastrian laymen. It's possible Judaism got the idea of multiple heavens at this time. In fact, the word "paradise," one of many words used to reflect heaven, comes from the Persian for "enclosed park or garden."
Judaism might also have been influenced by the ancient Babylonian tales. Perhaps Abraham brought the mythology with him from Ur. The parallel affiliation with celestial bodies indicates a closer relation to Babylonian stories than Zoroastrian.
Islam's Seven Heavens
Islam adopted the idea of seven heavens from apocryphal Jewish writings. In Islam, the word for heaven is garden. It is a place where all wishes will be fulfilled. The levels are separated by gates which can be opened if the person observed certain rituals on earth, such as jihad, charity, fasting, and pilgrimage to Mecca.
The Qur'an briefly mentions Muhammad's journey through the seven heavens, but Hadith literature describes the story more fully. Muhammad was at the Sacred Mosque in Mecca, in a half-dream state, when the angel Gabriel appeared with Buraq, the heavenly steed of the prophets. Buraq took Muhammad to the Western Wall in Jerusalem, where Muhammad prayed and was tested. When he passed the tests, Gabriel and Buraq took him on a tour of the heavens. Muhammad claimed he met several people in the different levels: 1. Adam, 2. Jesus and John the Baptist, 3. Joseph, son of Jacob, 4. the Muslim prophet Idris, 5. Aaron the priest, 6. Moses, 7. Abraham. In the seventh heaven, he also saw the Nile and the Euphrates and possibly the Tree of Life.
But it's doubtful Muhammad's story is original. In a Zoroastrianism story that pre-dates Islam by over 1000 years, the priest Arta Viraf is said to have travelled through the heavens to speak with Ormazd, the great deity of the whole universe.
Dante's Heavens
In the third part of The Divine Comedy, "Paradiso", Dante Alighieri also relates several levels of heaven, although they were always meant to be metaphorical. The celestial bodies represent virtues which increase in quality as one progresses. After are three theological virtues and the three capstones. Taken together, they greatly parallel Babylonian mythology.
The Moon: incomplete fortitude; the inconstant who broke vows and whose faith waxed and waned
Mercury: incomplete justice; those who were ambitious for earthly treasures more than godly justice despite the fact the value of their treasure is nothing compared to God's glory, as Mercury is hard to see so near the Sun
Venus: incomplete temperance; those who loved another more than God
The Sun: prudence; those who provided light for others with their wisdom; home to great Christian scholars
Mars: fortitude; martyrs of Christianity
Jupiter: justice; rulers and kings who championed justice
Saturn: temperance; monks who lived contemplative lives
The Fixed Stars: split into three levels containing those who mastered faith, hope, and love; includes Adam, the Virgin Mary, and the apostles as well, as "vicars" who did Christ's will on earth
The Church Triumphant: humanity cleansed by the blood of Christ
Primum Mobile ("first moved"): angels and other creatures never tainted by original sin
Empyrean: not technically a level of heaven as it is non-material; the dwelling of God
The Bible
But does the Bible mention seven heavens? Not in the way the Talmud claims. Paul said he was taken to the "third heaven" in 2 Corinthians 12:2. Although it appears to be the place of spiritual beings, no more is said about it. The scriptural examples of the seven heavens in the Old Testament are labored attempts to validate extra-biblical teachings.
But the concept of heaven gets complicated because of limitations of the English language. When it comes to "good places people go to after they die," the Bible does mention several, and several are referred to as "heaven." That does not mean they are layers, one atop another, for which we can strive.
The atmosphere over the earth: Genesis 1:1 says that God created the heavens and the earth. As mentioned, the Hebrew word here, shamayim, is distinct from the word used for the place souls go after death. It's also plural, which causes some heartburn with interpretation. It can mean the sky, outer space, or the abode of God, but here it's pretty obvious it means the sky since verse 28 mentions birds live there.
The temporary paradise where Christians and Old Testament God-followers go after death: This is called paradise (2 Corinthians 12:3; Revelation 2:7; Luke 23:43), "Abraham's bosom" (Luke 16:19-31), or sheol (Hebrew) or hades (Greek), which are generic terms for the place after death.
The place where God resides now: This is also shamayim in the Old Testament. When John visited heaven in Revelation, it was the Greek ouranos, which has the same ambiguous meaning. It appears that the sky is a metaphor for God's dwelling. Since He is spirit and is not constrained by linear time, He couldn't literally "live" in the sky.
The New Heaven and the New Earth: After the great war at the end of the millennial kingdom, God will destroy the earth and the heavens and make them anew (Revelation 21—22). When He does so, He will dwell with His people. All God's people will live there for eternity. The "heaven" here is also the Greek ouranos. When people speak of living in "heaven" forever, they really mean the New Heaven and the New Earth.
The only place the Bible mentions more than one heaven is 2 Corinthians 12:2, "I know a man in Christ who fourteen years ago was caught up to the third heaven—whether in the body or out of the body I do not know, God knows. And I know that this man was caught up into paradise—whether in the body or out of the body I do not know, God knows—" This wasn't meant to indicate multiple levels of heaven as other religions teach. Instead, it differentiates between the earth's atmosphere, space, and the spiritual dwelling of God. When the Scriptures say God lives in heaven, using the same words as sky, it doesn't mean that God lives with the clouds or the stars, just that He is above us spiritually and not encumbered by the limitations of land-based creatures.
Conclusion
Originally, the idea of seven heavens may have come from the seven celestial bodies closest to us. It is unknown how the mythology came to Judaism — possibly Abraham brought it with him from Ur. But it is not supported in the Bible. There is no scriptural support for the idea that God created seven heavens.