What is the biblical basis for the belief that people do not go to heaven or hell immediately when they die? Touch poignantly stated in a now closed question,

But if people are already in heaven this means that there really isn't much reason for Jesus Christ to return, because all those that believe in Him are already in heaven.
If Jesus Christ will return and all those that have faith in Him will be raised and be priests with Him for a thousand years, why make it seem as if the deceased are already in heaven? If someone dies and goes to heaven before the Last Judgement, what need is there for him to be judged at the final judgement? Hasn't he already been judged righteous if he is in heaven?

In The Bible and the Future, Anthony Hoekema states that since Augustine, Christians have believed that the souls of those who die either rest peacefully, in the case of Christians, or are afflicted, in the case of the damned, after death until the resurrection. However, in my experience, it is nearly universally held among Protestants and Evangelicals that upon death, the soul ascends to Heaven in the case of the believer, or descends to Hell in the case of the unsaved. Hoekama also asserts that both Calvin and Luther believed in an intermediate state between death and resurrection, with Luther holding to a doctrine that the soul &quot;sleeps&quot;, and Calvin positing that the believer experiences an &quot;incomplete&quot; bliss.
While I am aware that views on the exact characteristics vary among those who admit an intermediate state, I am interested in how arguments that people do not immediately &quot;go to Heaven&quot; or &quot;go to Hell&quot; are framed in a biblical context, especially those that claim that existence in Heaven or Hell commences only after the bodily resurrection and the great &quot;White Throne&quot; judgement.
What are the biblical bases given for belief that people do not go to Heaven or Hell immediately after death?
Introduction
I intend to show that the concept of a universal realm for all, outside Heaven, where all await the resurrection (Waiting in the Grave, WitG hereafter) is united against other beliefs such as the belief we go Straight to Heaven (StH), that we cease to exist entirely with no afterlife or others such as purgatory/limbo.
While there are variations in WitG, they are all largely formed on the basis of common scripture and with the common concept that our focus should be on awaiting the resurrection as our reward, as our glorification and as a requisite for our eternal life with Christ. Their differences are not so much greater than any differences that occur among StH models.
Preconceptions
What makes this such an expansive topic is that it involves understandings of several key words and concepts that are contrary to the popular understandings of today. Concepts of the grave, hades or hell, life or soul, and heaven or paradise are subtly involved and must be well defined in order to understand the interpretations.
First, permit me to review, as concisely as I can, the foundational suppositions of those who hold to WitG as we build to the biblical evidence. I could simply list the bible chapter and verse references, but your question is asking for the biblical basis of an argument alternative to StH; not just the verses but how they are understood by those who believe WitG.
I will refer now to an eminent article written roughly 100 years ago by Elder Cortland Matthew Keach (1887-1925) titled &quot;Do the Saints Go to Heaven when They Die?&quot; (exact date written unknown). I encourage you to read the entire article in whole, but I will be drawing on it frequently as it is grounded firmly in scripture. He addresses many possible objections (arguments and scripture that StH present) that are beyond my scope here.
What is Heaven?
When one asks &quot;Do people go directly to heaven or hell at the moment of death?&quot; there is an implied definition of heaven that must be clarified.
Heaven is often depicted as the place of our eternal reward with God by StH, though when asked, the resurrection will be given lip service. WitG disagrees with this in all variations. Those who see this Heaven as a temporary waiting place may find they agree with WitG much more than they perhaps realized.
The more critical reader may see Heaven as the place that God dwells. It is outside creation or God dwells there temporarily, unseen, until he makes his home with us. Revelation 5:10, 11:15
What is Hell?
Likewise, we must address what this hell is. It is not really addressed in the OT, but we see it in the NT. However, in the NT Greek we must distinguish between three different terms translated hell: Hades, Gehenna and Tartarus. More on this: What is the difference between &#39;Hell&#39;, &#39;Sheol&#39;, &#39;Hades&#39; and &#39;Gehenna&#39;?
Those who hold to WitG understand Hades as was used by NT authors as the Greek language counterpart to Sheol, as we will see later when we compare their usage in scripture.
The final &quot;Hell&quot; of the second death after resurrection and judgment is reference to by Gehenna. The use Tartarus is admittedly unusual and beyond our scope here.
Old Testament Intermediate State
The OT see's death as a physical state. When one dies you are &quot;gathered to your fathers&quot; not in a spiritual sense, but literally, physically, in a grave shared by your fathers. There may be a figurative or even spiritual aspect of this as well, as Sheol better represents.
Sheol is the realm of death, located in the lower parts of the earth, though it is also used to speak of the state of death. It is simply where dead people are in a physical and abstract (or spiritual) sense.
Gathered to Family in Grave
Gen 25:5, Deut 31:16, 1 Ch. 17:11, 2 Ch. 34:28
Man being dead “in the Dust”
Job 17:16, Psa 7:5, Ecc 3:20,  Is 26:19, Daniel 12:2,
Sheol as State or Realm of Death
Gen 37:35, Num 16:30,33, 1 Sam 2:6, Job 7:9, 11:8, 14:13, 17:16, 21:13, Psa. 6:5. 9:17, 16:10, 30:3, 49:14-15, 86:13, 88:3, 89:48, 139:8. 141:7, Prov. 5:5, 7:27, 9:18, Isa. 7:11, 14:9
Notables:

Job 17:16 connects Sheol to “dust” and Ecc. 3:20 says “All go to one place. All are from the dust, and to dust all return. Daniel 12:2 Says we will awake from the dust.
Psalm 139:8, Job 11:8, Isa 7:11, Amos 9:2 make irrefutable distinction between Heaven and Sheol.
Job 14:13 Suggests Sheol is where Job expects to be until God “remembers” him (in the resurrection?) Also see Psa 49:15, Daniel 12:2

Hades used in same way
Matt 11:23, 16:18, Luke 10:15, 16:23, Acts 2:27 (Quote of Psa 16:10), Rev 20:13, 14
Notes:

Hades is again down not up in heaven
Abraham's bosom is identified with Hades by Jesus in Luke 16 (not Gehenna as Judaism describes it)
When quoting the Hebrew Sheol in the NT, Hades is used in Greek translation (the LXX does the same throughout the OT)

Abraham's Bosom
In the Second Temple Judaism concept of Abraham's Bosom there was a part of Sheol where the righteous would be greeted by Abraham (or Adam in earlier versions) and enjoy “paradise” while the unrighteous experienced discomfort. This is of great interest when we understand that the Sadducee denied the resurrection. They saw this paradise as their final rest while the Pharisee's saw it as a place of waiting for the resurrection. (Matt 22:23-32, Mark 12:18-27, Luke 20: 27-38, Acts 23:6-8) Does this sound familiar?
Early Church
The Early Church theologians and apologists seem to focus on the resurrection as the hope of the believer. The concept of looking forward to heaven after death is totally foreign, and even understood as denying the resurrection! This makes sense when we read Christ's rebuke of the Sadducees' denial of the resurrection and understand the early church would have connected an eternal “paradise” or “heaven” as subverting a future resurrection.
Justin Martyr
Justin Martyr is as emphatic on this topic as he is on any. In Dialogue with Trypho chapter 80 he says:

For if you have fallen in with some who are called Christians, but who do not admit this [truth], and venture to blaspheme the God of Abraham, and the God of Isaac, and the God of Jacob; who say there is no resurrection of the dead, and that their souls, when they die, are taken to heaven; do not imagine that they are Christians,...

And his description of the intermediate state sounds a lot like Sheol/Abraham's Bosom:

The souls of the pious remain in a better place, while those of the unjust and wicked are in a worse, waiting for the time of judgment. [Dialogue with Trypho Chapter 5.]

Conceptual Argument
Some arguments for WitG are not taken out of just one “proof text”.
Christ brings our reward to us in the resurrection after his second coming
Isaiah 62:11

“Behold, your salvation comes;
behold, his reward is with him,
and his recompense before him.”

1 Cor 4:5

Therefore do not pronounce judgment before the time, before the Lord comes, who will bring to light the things now hidden in darkness and will disclose the purposes of the heart. Then each one will receive his commendation from God.

Isaiah 26:19-21

Your dead shall live; their bodies shall rise. You who dwell in the dust, awake and sing for joy! For your dew is a dew of light, and the earth will give birth to the dead.

This is both the reward for good and for evil:
Revelation 22:12

“Behold, I am coming soon, bringing my recompense with me, to repay each one for what he has done.

Revelation 20:12

...And the dead were judged by what was written in the books, according to what they had done.

Daniel 12:1b-2

...But at that time your people shall be delivered, everyone whose name shall be found written in the book.
2 And many of those who sleep in the dust of the earth shall awake, some to everlasting life, and some to shame and everlasting contempt.

The Saints are not with Christ until his return
Other passages such as 1 Thess. 4:13-17 show us, if read carefully, that at the trumpet the dead rise and those who are alive are gathered with them to be with the Lord forever. This is often used to support StH but logically it cannot be so! For if the promise of being with him forever does not start until the trumpet and Christ's coming, how can the dead already be in heaven before his coming?  As we see in John 14:3

And if I go and prepare a place for you, I will come again and will take you to myself, that where I am you may be also.

Also often used by StH, this passage shows instead that the saints, alive or dead, are not taken to be with Christ until after he comes again. And where is Christ that we may be with him? Here! For he has come again at that point!
It will be noted that this then starts to enter the realm of the debate on the Rapture. It is common for WitG adherents, such as Adventist groups and LDS, to deny a “secret rapture” and hold to it referring to a literal gathering of the saints to Christ at Jerusalem, as a corroborating doctrine. It is my personal opinion based on study of theological history, that the idea of StH has directly lead to the concept of the secret rapture by necessity in order to avoid the WitG understanding.
Where are they? David, Samuel, Jesus
When David's first son with Bathsheba dies at birth, David exclaims “I shall go to him, but he will not return to me.” And yet where did David go upon dying? Peter tells us in Acts 2:34, when arguing that scripture prophesied of Jesus, “For David did not ascend into the heavens”. Unless we are going to say Peter was wrong, and David did go to heaven and the psalm attributed to Jesus really was about David?
Also, when Saul consults the witch of Endor (1 Sam 28:13), the spirit identified as Samuel says, “tomorrow you and your sons shall be with me.” Either this is a false spirit from Hell (who gives Saul correct prophecy) or Samuel and Saul and his sons are together in heaven or hell. Would it really be Samuel's place to promise Saul heaven?
Jesus words to the thief on the cross (Luke 23:43) make far greater sense when one considers the “paradise” he is referring to is the peaceful, temporary rest of the dead, not an eternal existence in heaven. For we are told by Christ after he was resurrected (John 20:17) that “Jesus said to her, “Do not cling to me, for I have not yet ascended to the Father” and Paul confirms in Ephesians 4:8-10 “In saying, “He ascended,” what does it mean but that he had also descended into the lower regions, the earth?” Unless we are to say that Christ ascended to heaven as StH would claim, then returned with his resurrection only to ascend again and that we are truly awaiting his third coming? (Indeed, the fourth, after the secret rapture?)
Common Variations
Abraham's Bosom/Paradise
As mentioned before, still held by some in Judaism. However, even modern Orthodox Judaism see “heaven” as after the resurrection! Still held by some in similar form as described by Justin Martyr (had a recent conversation confirming this or unconsciousness is the general belief of the Amish).
Unconsciousness of the Dead/Soul Sleep
Some believe that the consistent pattern of being compared to sleep in the OT and NT, combined with the OT descriptions of a knowledge-less Sheol points to an unconscious or semi-unconscious dream-like awareness in the intermediate state.
Best known are the Seventh-Day Adventists, but there are some other smaller denominations such as the Advent Christian Church (related in origin to the 7th Day, but are fairly normal evangelical denomination).
Jehovah Witnesses
Jehovah Witnesses believe the dead cease to exist, but are remembered by God. Their argument uses similar scripture and plays out very similar to that of unconsciousness of the dead.
Latter Day Saints
The LDS believe in a &quot;Spirit World&quot; Again, the focus is on a realm where spirits await the resurrection. Very similar to Abraham's Bosom with a few peculiarities that make it worth mentioning separately.
WitG before Christ, StH after
There are some, with no official denominational stance that I'm aware of, that hold to the idea that Sheol and Abraham's Bosom existed prior to Jesus' resurrection, but that afterward he took or sent the saints to heaven and the reprobate to hell.
This is a common compromise among theologians and pastors familiar enough with the Old Testament that they cannot deny the strength of the concept of Sheol as we examined earlier, but wish to hold to a StH view.
Conclusion
Doctrinal history shows the concept of a holding place for the souls of the dead awaiting the resurrection is the view at least by the Second Temple period Judaism, if not earlier, and then the early church. Variations are based largely on the nature of our state there, be it conscious or unconscious, or in comfort or discomfort, on it's division, whether all are in the same place or it divided in two or more sections, or on the nature of man himself, immortal or not. But these particulars do not deviate enough from the basic concept to not be united in their supporting scriptures. There is a wealth of scripture speaking on the human state after death but prior to Christ's second coming and the resurrection for those willing to look.