The story of Adam and Eve or history I should say, was passed down from generation to generation. But 99.9% of it came when Moses wrote the first five books of the Bible. God gave him the words to write down and therefore allowed him to accurately record the event.
The biblical story of Adam and Eve is a composite that scholars say evolved from older stories in the Egyptian, Mesopotamian and Canaanite mythologies.
In Genesis, when God began to create the world, there was a watery chaos. God planted the Garden of Eden, where Adam and Eve lived an idyllic existence. 'Eden' is derived from the Sumerian edin, meaning "a plain" or "open country".
In the ancient Sumerian creation story, earth emerged from a watery chaos, and the gods planted a watered garden where humans lived in paradise. Gilgamesh was an oppressive ruler, so his constituents appealled to the gods, who create a nemesis, Enhdu. Born naked in the wilderness, Enkidu was tempted by a harlot, who educated him about sin and taught him to wear clothes. The similarities to Adam and Eve are striking.
S. H. Hooke (Middle Eastern Mythology) shows a clear parallel between the biblical account of Cain and Abel, and an older Near Eastern myth in which Tammuz had to choose between the shepherd-god and the farmer-god.