A polymeric-perovskite heterostructure of SrTiO3/g-C3N4 modified by Ag nanoparticles was synthesized through a co-precipitation process in order to prepare a novel photocatalyst. In-depth analysis of the structural, optical, and morphological properties confirmed that the incorporation of g-C3N4 nanosheets and Ag nanoparticles into the host structure narrowed the band gap from 3.18 to 2.87 eV, reduced the mean particle size from 70 to 48 nm, increased the mean pore size and the specific surface area, in addition to modifying the electronic band structure. Using response surface methodology (RSM), the optimum experimental parameters for photocatalytic activity were determined to be a dye concentration of 11.2 mg/L, an irradiation time of 47 min, and a photocatalyst dosage of 1.23 g/L. The SrTiO3/g-C3N4/Ag photocatalyst shows a high photocatalytic activity by complete degradation of methylene blue (MB) dye under visible light irradiation. Following the scavenger test, the h+, •O2–, and •OH radicals are all essential to dye degradation. Rhodamine-B (RhB) and methyl orange (MO) dyes showed a lower degradation rate as compared with MB and dye. The experimental evidence supported the proposal of a Z-scheme charge transfer pathway for the photodegradation of organic dyes.