The short answer is "not much" - but there are several layers of issues here.
First, I'm not sure what you mean by the word "myth" because people use it in a variety of ways - not all appropriate. I assume you mean it in the preferred sense to refer to texts from the ancient world that record stories and information about the gods and heroes of fantastic exploits. So - what do we know about the origin of these stories? Sadly, the answer is next to nothing. These stories emerge into the written record in a way that suggests they were fully formed and that ancient authors "lifted" the stories from an oral tradition for which their texts are the only records. One of the reasons we can conclude that they these stories existed in a vibrant oral tradition is that we can often find analogues (similar stories) in other places, suggesting that each of these sources have a common ancestor that was not a matter of literature but rather was a part of an older oral tradition. This places the "origin of myths" into an unfathomable prehistoric period, and we cannot do more than speculate about this prehistoric period and how these stories and beliefs formed.
There is something of an analogy when it comes to the origin or oral narrative, but it is no more satisfactory. In the second half of the twentieth century, folklorists realized that a new body of oral narratives (Urban Legends) were bursting onto the scene, and it gave hope that it might be possible to track down sources and to understand how these stories originated. The following in an excerpt from my Introduction to Folklore dealing with this endeavor and the question of the origin of stories:
The answer to this question is somewhere between "we don't know" and "it's just what people do" – that is, they invent these sorts of stories. Several folklorists, including the late Alan Dundes and Jan Harold Brunvand, recognized an opportunity with recent urban legends to finally track down "the source," the point of creation, to better understand how stories originate. For the most part, they were unable to find the point/person of origin to any general degree of satisfaction. It is a maddening question, and much like the proverbial chicken and the egg, it isn't likely to be resolved.
People tell stories. People repeat stories. And as they repeat them, people modify stories, which sometimes results in the birth of new stories. There might have been some highly imaginative, creative people who invented stories at some point, but that sort of person has yet to be identified in the annals of folklore studies. Folklorists often asked renowned storytellers to tell a new story, to invent something that they had not heard. Without exception, these requests were refused by the storytellers who explained that while they repeated stories, they did not invent them. In general, it may be best to consider the possibility that the process of repetition and transmission is the source of much of the creativity that is evidenced in the international library of oral tradition.
One example may help shed light on the creative process: the Cornish droll tellers were known for their wild adaptation of the material they heard. Their counterparts in Ireland were the seanchaithe, professional storytellers who prided themselves in the faithful recitation of stories they had heard, as close to the original as possible. Perhaps in this, we can see the opportunity for new stories to be born, and indeed, Cornish oral tradition includes more than its fair share of distinct subtypes (i.e. variants) of legends and folktales, perhaps offering a hint as to how these things may come into existence.
So the closest answer to your question is that as soon as people could communicate with complex sentences, they were probably telling accounts of exploits and of various things. Repetition led to variation, and variation was likely the source of new stories. Mostly, this is purely speculative since all this occurred in a black box - removed from the written record, and so all we are left with is an understanding of how oral tradition works and how it might have functioned in a remote time in a prehistoric past.