Over vast periods of time, our primitive oceans formed. Water remained a gas until the Earth cooled below 100 degrees Celsius (212 degrees Fahrenheit). At this time, about 3.8 billion years ago, the water condensed into rain which filled the basins that are now our oceans.
Most scientists agree that the atmosphere and the oceans accumulated gradually over millions and millions of years with the continual ‘degassing’ of the Earth’s interior.
According to this theory, the ocean formed from the escape of water vapor and other gases from the molten rocks of the Earth to the atmosphere surrounding the cooling planet.
After the Earth's surface had cooled to a temperature below the boiling point of water, rain began to fall—and continued to fall for centuries. As the water drained into the great hollows in the Earth's surface, the primeval ocean came into existence. The forces of gravity prevented the water from leaving the planet.