today in America and in Israel, the word "day" commonly means a 24-hour period. But the book of Genesis wasn't written today; it was written thousands of years ago, and it was written in ancient Hebrew. In that language, yôm = "day" could mean any of 3 different things:
a 24-hour period, from sunset to sunset (or from midnight to midnight), or
the hours of daylight per 24-hour period, approximately 12 hours (varying from one latitude and season to another), or
a period of time other than a 24-period or the hours of daylight, often unspecified.
Here are examples in the Old Testament of the last case above, where "day" (yôm) is not referring to a 24-hour day at all but, rather, to longer periods of time:
These are the generations of the heavens and of the earth when they were created, in the day that the Lord God made the earth and the heavens. (Genesis 2:4)
In that day the Branch of the Lord will be beautiful and glorious, and the fruit of the land will be the pride and glory of the survivors in Israel. (Isaiah 4:2)
For the Lord has a day of vengeance, a year of retribution, to uphold Zion's cause. (Isaiah 34:8)
After two days he will revive us; on the third day he will restore us, that we may live in his presence. (Hosea 6:2)
Woe to you who long for the day of the Lord! Why do you long for the day of the Lord? That day will be darkness, not light. (Amos 5:18)
In none of these cases does "day" (yôm) refer to a 24-hour day. Moreover, the seventh "day", mentioned in Genesis 2:2,3, is not a 24-hour day because we still are in it. God is continuing to rest, during this Sabbath, from His task of creating anything out of nothing. Thus, "day" does not have to mean a 24-hour period when speaking of each creation day in Genesis 1.