What is the difference between the Talmud and the Torah?
The Torah is the book with the commandments and history.
The Talmud is the book that talks about why we do things, is that the correct way to do it, and so on.
Jewish tradition states that the Torah was given by God (Exodus 24:12) and written by Moses in his lifetime (Deuteronomy 31:24). Similarly, the rest of the Tanakh (Jewish Bible) is books of prophecy, each of which was written by the prophet whose name it bears. The Tanakh was handed down with the utmost care that it not be altered.
The Talmud is the Oral Torah, which for some 1800 years was handed down verbally by the Sages. It was permitted to add to the Talmud, such as the stories it contains about the lives of the various Sages. The function of the Talmud is to clarify the Torah, to comment on it and to specify the halakha (law) when the Torah does not.