What is the Biblical view? The earlier parts of the Bible, and those most strongly based in Jewish experience, are unclear. The dead seem to go to "sheol", some kind of deathly limbo, but it is unclear whether this is doctrine or simply a middle eastern cultural accrescence or a poetic figure of speech. Later in the Bible there are frequent references to a type of "annihilation", "death" or destruction". This is said, for example, to be the fate of the wicked in the first Psalm, as opposed to the fate of the righteous, who are given life through intimacy with God. This understanding seems more truly Jewish, as it is just (why would all souls be sent to a dreary limbo by a loving God of justice?) and resonates with the central idea of God as the God of life- the creator of the good, of the orderly, of the beautiful- and the defeater of chaos, entropy and death (this theme is prominent in Genesis, Job and the Psalms).
The later assumption of Christian theology (based partially on some New Testament texts we will discuss below) is that some souls will live forever in blessed and blissful proximity to God and some will be consigned to everlasting torment- a kind of eternal dungeon or prison filled with torture and horrors. Where does this model come from? Not from the Tanakh (Hebrew Bible). Eternal life is hinted at in several places, with a vague idea of celestial bliss, but eternal tortures are not. The text seems to imply, as said previously, either annihilation or (in its earliest layers) or some kind of shadowy half-existence.
We can learn something, perhaps, by the justice system actually instantiated by God in the Hebrew Bible. What is the nature of punishment there? Well, an examination yields two possibilities: 1) making amends through paying a fine; 2) death. One must also offer a sacrifice to God, though this is not a juridical matter.
This matches the Biblical picture of God's justice. When we must either make amends, if possible, or if not (because our sin is too heinous) we will be destroyed. It is noteable that the two possibilities of Eden also match this: sin leads to death, whereas obedience would have lead to eating of the tree of immortal life.
Notice that Biblical justice does not include prisons, torture, or dungeons. Where did these ideas come from? Rome. The Roman justice system sent people to dungeons to be tortured and kept people in prisons for long periods of time. Most often this was while awaiting trial or execution (even Roman justice didn't imprison people forever!) but still the Roman dungeon/prisons, which were horrific places, are likely the source of the idea of a "divine dungeon" that arises in late second Temple Judaism and early Christianity. Add to this Graeco-Roman mythology: here we find the idea of Tartarus, or Hades. As endorsed by Plato, unrighteous souls find their destiny here where they are tortured for eternity with "just desserts". The tortures of Hades match the crime with a horrible poetic justice, and there is no salvation from this relentless, eternal justice.
This horrific vision seems to have influenced Judaism to some extent, and massively influenced Christianity.
Later Midrashic literature (whether halachic like the Talmud or agaddic) contains the idea of gehennom, a firy place of suffering possibly modelled after the burning rubbage heaps outside of Jerusalem. Although some Rabbis seemed to have thought gehennom eternal the mainstream view was that it's punishment was purgatory and temporary. The destiny of most was olam haba (the world to come) though many would need to be refined in gehennom before going there. The mainstream view that developed over time was that of a spectrum: the average sinner would go to gehennom and than to olam haba; the very righteous would go right to olam haba. The very wicked would be annihilated. In this way the rabbis seem to have remained true to the Biblical witness while incorporating a modified hades/tartarus who purpose was both punitive and pedagogical, or just and reformative.
The New Testament
The New Testament's witness, it must be said, is not entirely clear. Jesus warns of "the outer darkness", "the relentless fire" and "eternal punishment". Jesus also warns against "hades/tartarus" and "gehennom". He seems, then, to be making use of the terminology and ideas of Hellenized Judaism in order to warn of types of suffering and death that await the unrighteous after death. One type seems to be a type of painful alienation from God pictured as "the outer darkness" outside of a place of warmth and light (the messianic banquet?). There there is "weeping and gnashing of teeth", which sounds like grief and regret. The time period they will be there, and whether there is any escape, is not spoken of, and this is a very vague and poetic metaphor which doesn't lend itself to picayune analysis. As George Macdonald pointed out, it may be that the purpose of the expulsion into the outer darkness is to provoke the grief and regret which will lead to repentance and restoration. We don't know.
The "eternal punishment" mentioned is also not clear- the Biblical use of "eternal" is often hyperbolic and vague. It cannot confidently be interpreted as an eternal experience of punishment- it may refer to an unchangeable punishment, or one with eternal ramifications, which might refer to annihilation not eternal torture as in the Greek Hades. The "relentless fire" requires careful interpretation because we automatically imagine the eternal hellfire of later Christian imagination. This phrase must be balanced though with Jesus' warning that we should not fear humans but rather God, who can "destroy both body and soul in the fire of gehennom". The fire, then, does what fires normally do- it burns until it consumes its fuel completely, ie. it destroys. Even the soul is here pictured as annihilated. This fire is relentless because it will consume until the soul is annihilated.
When understood this way Jesus' warnings are harmonized with the rest of Biblical witness and the general thrust of Jewish thought (surely a more congenial home than Graeco-Roman thought). To summarize: after death there are three options: eternal life with God; some type of purificatory/punitive/purgatorial experience; or annihilation.