Graphitic carbon nitride (g-C3N4) was prepared by the polycondensation of melamine at 650 °C for 2 h, then thoroughly characterized by X-ray diffraction, Fourier transform infrared spectroscopy, X-ray photoelectron spectroscopy, elemental analysis, transmission electron microscopy, N2 adsorption–desorption isotherms, UV–Vis diffuse reflectance spectra and photoluminescence spectra. The photocatalytic activity of g-C3N4 catalyst was evaluated by the degradation of Rhodamine B, Methylene blue and phenol solution under visible-light irradiation, which showed that g-C3N4 calcined at 650 °C increased the degree of condensation, thus led to the decreased band gap and exhibited better photocatalytic activity than the reference sample treated at 520 °C and P25. The integrated positive effects of porous structure, larger surface area, stronger visible-light absorption and higher separation efficiency for photoinduced electron–hole pairs over g-C3N4 treated at 650 °C resulted in its improved photocatalytic activity for degrading pollutants. Additionally, the as-prepared g-C3N4 possessed good structural and catalytic stability after three recycles.