The Earth was once a big hot rock that took billions of years to cool down

Where did the water on Earth come from?

2 similar theories - 

From asteroids crashing on Earth and depositing all of the water 

or

From primitive meteorites and dust particles that originally clumped together to form the planet, which were filled with hydrogen. Over time, as the Earth's interior heated up, this trapped hydrogen reacted with oxygen, and the resulting water was forced up to the surface as steam through volcanic eruptions and degassing. When the planet cooled sufficiently, this steam condensed into torrential rain, filling the early oceans