First, your question seems to imply a predefined notion of the concepts of heaven and hell. There is much discussion about these concepts amongst the Sages of the Talmud, the Rishonim, and Acharonim.
- Heaven: There is much reference in Talmudic literature to an afterlife for the righteous (i.e. those who follow God's commandments) called "Olam Habah" (World to Come). The Rishonim generally describe it as a pure spiritual connection between the soul and God's "essence", generating an intimate relationship with God. This is something that one in this world cannot imagine. (See Rambam Hil. Teshuva 8:6-7; Chovos Hal'vavos, Bitachon:4.)
- Hell: The afterlife of those who sinned is referred to in the Talmud as "Gehinnom", which is a reference to a geographical location mentioned several times in Tanach (גיא בן הינום), though the concept of which is purely spiritual and divorced from any physicality. Several (metaphorical) descriptions of Gehinnom are given, such as it being fiery (Berachos 57b) or a period of continuous unrest (Pirkei R' Eliezer 34). Rambam seems to believe that there is no afterlife for sinners, but that they will rather cease to exist after death. (See @RCW's answer.)
Second, with regard to your question,
Were these part of Judaism from beginning?. Following the Jewish belief in the oral tradition imparted by Moshe through the Neviim and through the Sages of the Mishna and the Talmud, we must assume that these concepts are part of the tradition received by Chazal, and thus were indeed part of Judaism from its beginning.
Finally, regarding your second question, there is no definite reference to the concepts of Olam Habah or Gehinnom in the Tanach. There are, however, hints and inferences to them. The source that is generally used to show that there is a concept of afterlife, that is, the continued spiritual existence of the soul after death, is from Koheles 12:7:
וישב העפר על הארץ כשהיה והרוח תשוב אל האלהים אשר נתנה
Additionally, Chazal counted Abigail among the female prophets and assumed her knowledge of the afterlife, both its positive and negative sides, from her words in Shmuel 1:25:29:
והיתה נפש אדני צרורה בצרור החיים את יהוה אלהיך ואת נפש איביך יקלענה בתוך כף הקלע
To address why there is no (definitive) mention of the afterlife throughout Tanach, R' Dessler (Michtav Me'Eliyahu vol. 5, p. 391) explains that in the earlier generations, when there existed prophesy and God's presence dwelled on Earth (in the Temple), there was no need to depict Olam Habah. People's perception of the world was of a continuous existence of the soul; they were simply more in touch with their spirituality and connection to God than people of later generations. To the earlier generations, this world was seen as just an Olam Habah with an added physical aspect. There was not so much of a distinction drawn between the two worlds. Therefore, it warranted no mention in those times; it was a given. Later, after the destruction of the Temple and discontinuation of prophesy, people had to grapple with the concepts of Olam Habah and Gehinnom.