The thermal evolution of magma oceans produced by collision with giant impactors late in accretion is expected to depend on the composition and structure of the atmosphere through the greenhouse effect of CO2 and H2O released from the magma during its crystallization. In order to constrain the various cooling timescales of the system, we developed a 1-D parameterized convection model of a magma ocean coupled with a 1-D radiative-convective model of the atmosphere. We conducted a parametric study and described the influences of the initial volatile inventories, the initial depth of the magma ocean, and the Sun-planet distance. Our results suggest that a steam atmosphere delays the end of the magma ocean phase by typically 1 Myr. Water vapor condenses to an ocean after 0.1, 1.5, and 10 Myr for, respectively, Mars, Earth, and Venus. This time would be virtually infinite for an Earth-sized planet located at less than 0.66 AU from the Sun. Using a more accurate calculation of opacities, we show that Venus is much closer to this threshold distance than in previous models. So there are conditions such as no water ocean is formed on Venus. Moreover, for Mars and Earth, water ocean formation timescales are shorter than typical time gaps between major impacts. This implies that successive water oceans may have developed during accretion, making easier the loss of their atmospheres by impact erosion. On the other hand, Venus could have remained in the magma ocean stage for most of its accretion.