Vehicle exhaust seriously pollutes urban air and harms human health. Photocatalytic technology can effectively degrade automobile exhaust. This work prepared g-C3N4/CeO2 photocatalytic material by constructing heterojunctions. Four kinds of g-C3N4/CeO2 composite photocatalytic materials with different mass ratios were prepared. An indoor exhaust gas purification test was carried out under natural light and ultraviolet light irradiations. The optimum mass ratio of g-C3N4 material and CeO2 material was determined by evaluating the exhaust gas degradation effective. Moreover, the structure and morphology of the g-C3N4/CeO2 composite were investigated with microscopic characterization experiments (including XRD, TG-DSC, FT-IR, UV-Vis, SEM and XPS). The results obtained were that the optimum mass ratio of g-C3N4 material to CeO2 material was 0.75. The degradation efficiencies under ultraviolet irradiation in 60 min for HC, CO, CO2, NOX were 7.59%, 12.10%, 8.25% and 36.82%, respectively. Under visible light conditions, the degradation efficiency in 60 min for HC, CO, CO2 and NOX were 15.88%, 16.22%, 10.45% and 40.58%, respectively. This work is useful for purifying automobile exhaust in the future.