Question: How long was the flood? GEN. 7:17, 8:6 says the flood was on the Earth 40 days and nights (GEN. 7:24, 8:3 says the flood was on the Earth 150 days
Response: The verses are talking about two different things. Genesis 7:17 and Genesis 8:6 say that it rained for 40 days. Genesis 7:24 and Genesis 8:3 say that the flood lasted for 150 days. There is no contradiction. It rained for 40 days, causing a flood that lasted 150 days.
Incidentally, the Hebrew word that is being translated as "Earth" in the question above is the Hebrew word 'erets, which also can be translated as "land" or "country."
By the way, in Hebrew, there is a literary device called "chiasm," in which a series of statements are mirrored in subsequent statements. Take a look at the chronology of references to the flood in Genesis and you can see that there is a "mirrored" or symmetrical structure:
7:4 - 7 days to wait for the flood
7:10 - - 7 days to wait for the flood
7:12 - - - 40 days of rain
7:24 - - - - 150 days of the waters rising
8:3 - - - - 150 days of waters retreating
8:6 - - - 40 days of waiting
8:10 - - 7 days of waiting
8:12 - 7 days of waiting