Gravity was created on the second day. Matter space and time existed before gravity was created. This has profound significance for theoretical Physics but we're going to ignore that for now.
The second clue to deducing the creation of gravity is from Genesis 1:6-8. Now for the first time creation has an orientation. This theme continues throughout scripture. Under and above are synonyms for up and down.
The firmament, third heaven, originally had a portion of the deep covering its outer surface. At the time of Noah's flood the windows of heaven opened and the water poured through and flooded the Earth.
One of our favorite ways to study the Bible is to follow a doctrine through from the first time it's mentioned to the last. This is a great way to develop understanding of the doctrine in the broad narrative of scripture.
Night was the darkness that resulted from the creation of light. Now God has gathered up all the darkness into a ball at the center of a spherical creation so night, technically, is inside the earth at this point.
Life has an orientation. Earth is down and the sky is up. Hell is below, heaven is above. Whatever happened on the second day has to allow for the formation of heaven and hell.
Many people have struggled with interpreting creation of the firmament. The simple definition is "expanse," so most translations render the meaning as "the expanse of the sky."