In Genesis, the Flood waters prevail over the earth for 150 days after the rain begins.
Genesis first says that rain falls for forty days and forty nights. It then gives a longer duration for the waters themselves: they prevail over the earth for 150 days. The distinction matters because the narrative describes an extended period of rising and remaining waters, not only the period of rainfall.
The 150-day figure appears in the account before the statement that God remembers Noah and causes a wind to pass over the earth. After that turning point, the waters begin to subside. Genesis later provides additional dates for the Ark’s resting, the visible reappearance of the mountain tops, and the drying of the ground.
Readers often answer forty days because that is the story’s most famous time period. Forty days refers to the rain, whereas 150 days refers to the waters prevailing.