Judaism believes that the Torah was given to Moses at Sinai directly by G-d. The 613 commandments, at least generally, were written down into what we know as the Five Books of Moses (Genesis, Exodus, Leviticus, Numbers, and Deuteronomy). But many details and instructions regarding these commandments were not written down. The Written Torah itself hints at this at several places, most obviously at Deut. 12:21, where G-d says "Then you may slaughter of your herd and flock...as I have commanded you." One problem, nowhere in the written Torah is there any commandment regarding how to slaughter. From this verse we know that the method was taught by G-d to Moses and he, in turn, orally taught those details to Joshua and the Elders, who in turn passed it on to their successors, and so on.
Many commandments beg for further definition, such as the fact that the Torah forbids working on Shabbat, but it does not tell us what "work" entails for this purpose. But its apparent from the story in Numbers 15:32-36 that the Jewish people in fact knew what acts of work were forbidden on Shabbat. In those verses we learn that the congregation found a man gathering sticks on the Sabbath, but they brought him to Moses for determination of punishment, since they had not yet been taught what punishment was appropriate. According to our tradition, Moses learned of 39 categories of work from G-d at Mt. Sinai and conveyed those orally to future generations. Mishna, Shabbat 7:2. A violation of any act proscribed within these 39 categories is therefore a Biblical violation since it was directly taught by G-d.
The rabbis, especially the Pharisees, preserved the orally transmitted Torah lessons from generation to generation with special care not to deviate from the teachings. They also legislated rabbinic commandments, which are of a lower level of importance than Biblical commandments, in order to create a "fence around the Torah" -- that is these rabbinic commandments were designed to help average Jews from violating Biblical commandments. So, in summary, there were three levels of commandments -- (1) those commandments specifically mentioned in the Written Torah; (2) G-d given commandments known from the Oral Torah; and (3) rabbinic ordinances. The Torah, in many places recognizes these three types of commandments, e.g. "...I command you this day to ... keep His commandments and His statutes and His ordinances...." Deut. 30:16. By referring to G-d's "commandments", "statutes", and "ordinances", the Torah is recognizing the existence of the written Torah commandments, the Oral Torah commandments, and the Rabbinic ordinances.
In Mishna Avot we have a record of how the oral law was passed down from generation and which sages were charged with preservation and teaching of the oral law, demonstrating an unbroken chain. The history of the subsequent transmission of the Oral Torah and the creation of the Talmud was recorded in the Iggeret Rav Shirer Hagaon, a letter from the head of the famous Babylonian academy of Jewish study at Pumpedesia (now a part of Baghdad) which had a continuous history dating back to the destruction of the First Temple through a generation or two after Rav Shirer died (1000 CE). This letter is cited in Maimonedes' (Rambam) introduction to the Mishna Torah. In the letter Rav Shirer explains that the oral law was faithfully and accurately transmitted, with no disputes among the rabbis, until the time of the Roman conquest of Israel. At that time, students were not as attentive to their teachers as they should have been (students would attend to their teachers 24/7 and in that way would absorb not only the formal lessons of their teachers but also the thought process involved). The first dispute in Torah learning occurred under the leadership of Rav Avtaylon. In the next generation, the zuggim, Hillel and Shammai, were reported to disagree on three issues of law. However, in the subsequent generation, the competing academies of Hillel and Shammai disagreed on numerous issues.