The Bible doesn't say. At Genesis 1:1 the heavens and earth were complete, and after an apparent pause for an indeterminate period of time the 6 creative "days" or epochs, each also taking an indeterminate period of time were complete. The seventh day, one of rest, which began after the end of the sixth day, continues on to this day thousands of years later. (Genesis 2:1-3 / Hebrews 4:3-11)
That's right in Genesis 1:1, doesn't say when the Universe or the earth was created nor does it say when the atmosphere/air as being created either.
But however, we do have a pretty good idea just about how old, the earth maybe, seeing the dinosaur bones dates back to some Millions of years old, That would mean, the earth as being just as old or older, than any 6000 years, as the young earth creationist believe the earth to be.
So we know the earth is at lease Millions of years old.
Here's an interesting question
In Genesis 1:2--"And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters"
Note ( And the earth was without form)
Note the word ( was )
The word ( was ) being translated in the Hebrew language in the Strong's concordance #1961-1933, and in the Companion bible.
Meaning of "was" = become or became )
Therefore Genesis 1:2, The earth wasn't created without form and void.
The earth ( become - became ) without form and void.
So the question is, What happen for the earth to ( become - became ) without form and void?
God didn't create the earth without form and void, The earth became without form and void,
So what happened, to the earth that it became without form and void?
Throughout the bible tells what happened, that the earth became without form and void.