According to Genesis, the Flood waters prevailed over the Earth for 150 days, or five months.
Genesis 7:24 states that the waters prevailed for 150 days. Genesis 8:3 then says that the waters receded after those 150 days, linking the two statements and establishing a five-month period in the narrative. This is the period of dominant or prevailing waters, not the complete time Noah spent in the ark.
The chronology continues after the waters begin to fall. The ark comes to rest on the mountains of Ararat in the seventh month, and later Noah observes that the mountaintops become visible in the tenth month. The family does not leave until the following year, after the ground has dried.
This sequence is why “five months” should not be confused with the Flood’s entire timeline. Genesis uses several dated stages, including the rain, the prevailing waters, the appearance of the mountains, and the final departure from the ark.