Off-specular X-ray reflectivity measurements were carried out to follow the in situ development of surfactant-templated silica thin films at the air-water interface under conditions of controlled relative humidity and temperature, using an enclosed sample cell designed for this purpose. The results suggest a strong dependence of formation time and growth mechanism on ambient conditions. Thin films were synthesized at the air-water interface using cetyltrimethylammonium bromide (CTAB, 0.075 M) and a silica precursor, tetramethoxysilane (TMOS, 0.29-0.80 M) in an acidic medium. The studied humidity range was from 50 to 100%, the temperature was between 25 and 40 degreesC, and the TMOS/CTAB molar ratio was between 3.3 and 10.7. We observed that high humidity slows down the growth process due to lack of evaporation. However, increasing the temperature results in a decrease in the film-formation time. We proposed a formation mechanism for film growth as a consequence of phase separation, organic array assembly, and silica polymerization.