Graphitic carbon nitride (g-C3N4), with facile synthesis, unique structure, high stability, and low cost, has been the hotspot in the field of photocatalysis. However, the photocatalytic performance of g-C3N4 is still unsatisfactory due to insufficient capture of visible light, low surface area, poor electronic conductivity, and fast recombination of photogenerated electron-hole pairs. Thus, different modification strategies have been developed to improve its performance. In this review, the properties and preparation methods of g-C3N4 are systematically introduced, and various modification approaches, including morphology control, elemental doping, heterojunction construction, and modification with nanomaterials, are discussed. Moreover, photocatalytic applications in energy and environmental sustainability are summarized, such as hydrogen generation, CO2 reduction, and degradation of contaminants in recent years. Finally, concluding remarks and perspectives on the challenges, and suggestions for exploiting g-C3N4-based photocatalysts are presented. This review will deepen the understanding of the state of the art of g-C3N4, including the fabrication, modification, and application in energy and environmental sustainability.