Ammonia removal from synthetic wastewater was studied through a photocatalytic degradation process under UV light. In this study, TiO2/C3N4 was synthesized through a simple method of preparing g-C3N4 through the pyrolysis of melamine then adding it to TiO2. On the other hand, ZnO/C3N4 composite was prepared by a deposition–precipitation technique. The composites were described by Fourier transform infrared spectroscopy (FTIR), X-ray powder diffraction (XRD) and scanning electron microscope (SEM). Response surface methodology (RSM) has been utilized to model variables using Minitab 18. Calculated values of degradation efficiency were in good agreement with experimental values (R2 = 0.97 and Adj–R2 = 0.91). The influence of parameters over ammonia initial concentration (10–50 ppm), catalyst dosage (0.2–1.5 g), light intensity (6–30 W) and stirring speed (100–500 rpm) on ammonia removal percentage was investigated, and their main and interaction contribution was examined. The optimum conditions of the degradation were observed at a dosage of 1 g/L and initial concentration of ammonia 10 ppm for UV intensity irradiation with 24 W lamps. It was concluded that the photocatalytic degradation of the ammonia solution, after 50 min of UV irradiation, can reach percentages of 46%, and 52% using the catalysts TiO2/g-C3N4 and ZnO/g-C3N4, respectively.