In Genesis, Noah waited forty days after the mountain tops appeared before opening the Ark’s window.
Genesis 8:5 says that the waters continued to decrease until the tops of the mountains became visible. Verse 6 then states that after forty days Noah opened the window of the Ark. The sequence is about the recession of the waters, not the forty days and nights of rain at the beginning of the Flood.
That distinction matters because Genesis uses several separate time markers. Rain falls for forty days and forty nights; the waters prevail for 150 days; and Noah later sends birds to test the condition of the land. The repeated numbers can make the chronology easy to blend together.
Noah first sends a raven, then a dove. The dove eventually returns with an olive leaf and later does not return, but Noah still waits for God’s instruction before leaving the Ark. The window-opening episode therefore begins the final testing stage rather than ending the Flood immediately.