The exact time when the season of Advent came to be celebrated is not precisely known. Of course, it was not in practice before the celebration of the Nativity and Christmastide began; the earliest evidence shows that the feast of the Nativity of Our Lord was established within the later part of the 4th century. There are homilies from the 5th century that discuss preparation in a general sense, but do not indicate an official liturgical season. A Synod held in 590 established that Mondays, Wednesdays, and Fridays from November 11th until the Nativity would be offered according to the Lenten rite. This and other traditions, such as fasting, show that the period of time now established as the Advent season was more penitential (similar to Lent) than the liturgical season as we know it today.
A collection of homilies from Pope St. Gregory the Great (whose papacy was from 590-604) included a sermon for the second Sunday of Advent, and by 650 Spain was celebrating the Sundays (five at the time) of Advent. So it seems the liturgical season was established around the latter part of the 6th century and first half of the 7th century. For the next couple of centuries, Advent was celebrated for five Sundays; Pope Gregory VII, who was pope from 1073-85, reduced the number to four Sundays.