Did the ancient Hebrews believe there was a heaven and hell? Most likely not.
Most biblical scholars say they did not (this coincides with the fact that the Sadducees during the period of Jesus, which included all the Jewish temple priests, did not believe in a Resurrection).
Marcus Borg writes:
“For a long time now, mainstream biblical and theological scholarship has recognized that the belief in an afterlife did not emerge until nearly the end of the writing of the Hebrew Bible. The first unambiguous reference occurs in the last chapter of Daniel, seen by most scholars as the latest document of the Hebrew Bible, written around 165 BCE. Though the authors of the Psalms and other books often pray for deliverance from death, there is no clear affirmation of an afterlife until Daniel.This means that for all the previous centuries of the biblical period, people in ancient Israel didn’t believe in life after death. To state the obvious, “going to heaven” could not have been their motive for taking God seriously.”
The consensus of biblical archaeologists is that the Hebrew Bible contains much history but its “overlaid with legendary and even fantastic materials that the modern reader may enjoy as ‘story’ but which can scarcely be taken seriously as history.”
William G. Dever, commonly referred to as “America’s leading archaeologist of Israelite history” writes: “While the Hebrew Bible in its present, heavily edited form cannot be taken at face value as history in the modern sense, it nevertheless contains much history.
Let me begin by clarifying which books of the Hebrew Bible I think can be utilized by the would-be historian, whether textual scholar or archaeologist. With most scholars, I would exclude much of the Pentateuch, specifically the books of Genesis, Exodus, Leviticus, and Numbers. These materials obviously constitute a sort of “pre-history” that has been attached to the main epic of ancient Israel by late editors… As for Leviticus and Numbers, these are clearly additions to the “pre-history” by very late Priestly editorial hands, preoccupied with notions of ritual purity, themes of the “promised land,” and other literary motifs…
All this may be distilled from long oral traditions, and I suspect that some of the stories – such as parts of the Patriarchal narratives – may once have had a real historical setting. These traditions, however, are overlaid with legendary and even fantastic materials that the modern reader may enjoy as “story” but which can scarcely be taken seriously as history.”
(William G. Dever “What Did the Biblical Writers Know & When Did They Know It? – What Archaeology Can Tell Us About the Reality of Ancient Israel” 2001 – William B. Eerdmans Publishing )