Computer simulations of migration of planetesimals from beyond the Jupiter’s orbit to the terrestrial planets have been made. Based on obtained arrays of orbital elements of planetesimals and planets during the dynamical lifetimes of planetesimals, we calculated the probabilities of collisions of planetesimals with planets, the Moon, and their embryos. The results of calculations showed that for the total mass of planetesimals of about 200 Earth masses, the mass of water delivered to the Earth from beyond the orbit of Jupiter could be about the mass of the terrestrial oceans. For the growth of the mass of the Earth embryo up to a half of the present mass of the Earth, the mass of water delivered to the embryo could be up to 30% of all water delivered to the Earth from the zone of Jupiter and Saturn. The water of the terrestrial oceans and its D/H ratio could be the result of mixing of water from several exogenic and endogenic sources with large and low D/H ratios. The ratio of the mass of water delivered from beyond the orbit of Jupiter to a planet to the mass of the planet for Venus, Mars, and Mercury was not smaller than that for the Earth. The mass of water in planetesimals that collided the Moon and migrated from beyond the Jupiter’s orbit could be not more than 20 times smaller than that for the Earth.