Hey there! I'm not a musicologist, but I hope my answer helps.
Before time signatures came about, there was Gregorian chant. Rather than being metered, this chant had notes called Neumes that essentially said, "hey, you should hold this note for about this long." After a while, people started wanting something more definite. After all, music was getting more and more complex-notation needed to become more exact for people to know what was going on! At this time, Paris was the place to go for talented musicians. A number of them living in France around 1150 became known as the school of Notre Dame. The School of Notre Dame is widely known for penning the Rhythmic Modes. There wasn't a 4/4 yet though! Time Signatures were called Mensuration Signs, and instead of numbers, they were shapes (there's a lot more to say here, but it's icing on our cake). Although we sometimes think that the C meaning 4/4 is because we call it 'Common Time', the truth is that the Mensuration Sign for 2/4 looked like a 'C'.These gave us a basic idea of how we wanted beats (fun side note: some composers who opposed this trend thought it was completely ruining music! There will always be naysayers.)
Unfortunately, I can't find anything definite on when 4/4 started appearing, I can say that music as early as the 1200's was using using what is equivalent to our time signatures today. Most religious music at the time was composed in 3/8 or 3/4 because of its association with the Trinity, so 4/4 would have been more common after the Renaissance, and into the Baroque era of Music.
Sources: Roger Kamien. Music: An Appreciation. Burkholder, Grout, and Palisca. A History of Western Music.
A question of clarification: do you mean to ask how long we have had a formalized, written 4/4 (otherwise known as common time...which should give you an idea of how ubiquitous it is)? Or are you asking how long we have had the phenomenon of music expressing groups of four equal-length beats?
These will likely have two very different answers, and the second question will probably get a better answer from /r/askanthropology or /r/musicology.
Something to be addressed in your question is the fact that 4/4 time presupposes divisive rhythm. In Western music, the rhythm is almost always divisive; that is, we divide a measure into beats, those beats into smaller fractions, etc.
2/4 | . , . i . , . | . , . i . , . |
Here, "|" is the measure, "i" is the beat (a quarter note), "." is an eighth note, and "," is a sixteenth note. You can keep going, until it become pointless due to practical concerns (too fast to be played or perceived).
Some non-Western musics often use what is called additive rhythm, in which a beat is added to to make a rhythmic group, as opposed to the other way around. There are Western examples of this, but they are more recent (late 19th century on). It can be as simple as 5/4, which is not a simple division, to the wildly changing meters of Stravinsky's "The Rite of Spring."
The precise answer to your question lies in an entire chapter in Alfred Crosby's The Measure of Reality: Quantification and Western Society, 1250-1600:
[Gregorian Chant] is not quantified sound. In syllabic chant, for example, each syllable has one note, which is sung for as long as that particular syllable requires. That note is not necessarily an exact multiple or division of any other note; it is as long as it needs to be. Gregorian chant provides as clear an example of time measured solely by its contents as we are likely to find...
...Western monotheists, struggling in the early Middle Ages to establish monotheism among polytheistic and animistic believers, were sure there was only one right way to do things and only one right version of every chant: they needed a means of writing music down. The monks produced neumatic notation...[which was] little more thatn a collection of marks...pertaining not so much to time as to relative pitch...These, with dots and curlicues indicating subtler variations - surges, hoverings, trills - were called neumes, a word derived from the Grek for either sign or, more likely, breath. They pertained not necessarily to single notes, but to a syllable of the text...
Gregorian chant eventually gave way to polyphonic chanting, which required quantified tempo:
In Paris, at the epicenter of the Western cultural revolution, musicians strode forward on both of Guido's feet, first Leonin and Perotin - and then the theoreticians. If we intend to sing in unison, then starting, singing and stopping are not difficult. If we intend to sing polyphonically - that is, in several independent lines - then starting together will be easy, but everything from that instant on will tend to slide into anarchy. We need the guidance of sturdy forms and a temporal dictator; we need to know where we are going and the pace at which we are to march. To an extent the liturgy supplied the forms, but how long would these satisfy the young lions of polyphony? Leonin and Perotin and their anonymous colleagues supplied what was lacking in chant, a time control, a rhythmic measure.
...
Franco of Cologne...codified and standardized a system of notation establishing time values for all notes and rests, even insisting on unequivocal time values for a slippery slur of notes called ligatures. He proclaimed, to give a sample of his practical contribution, that there were four single-note signs in music notation, called the double long, the long, the breve and the semibreve. They were exact multiples or divisions of each other...
Theorists validated and systematized what practical musicians had invented in the years around 1200: not time as its contents, but time as a measuring stick of independent existence with which you could measure things or even their absence - abstract time. Franco of Cologne put it this way: "Time is the measure of actual sound as well as of the opposite, its omission."