Ammonia, the second most-produced chemical, is widely used in agricultural and industrial applications. However, traditional industrial ammonia production dominated by the Haber-Bosch process presents huge resource and environment issues due to the massive energy consumption and CO2 emission. The newly emerged nitrogen fixation technology, photocatalytic N-2 reduction reaction (p-NRR), uses clean solar energy with zero-emission, holding great prospect to achieve sustainable ammonia synthesis. Although great efforts are made, the p-NRR catalysts still suffer from poor N-2 adsorption and activation, inferior light absorption, and fast recombination of photocarriers. Due to the tunable electronic structure of the metal-free polymeric graphitic carbon nitride (g-C3N4), the above-mentioned issues can be significantly alleviated, making it the most promising p-NRR photocatalyst. This review summarizes the recent development of g-C3N4-based catalysts for p-NRR, including the working principle of p-NRR catalysts, the challenges of developing p-NRR catalysts, and corresponding solutions. Particularly, the roles of defect engineering and heterojunction construction on g-C3N4 to the enhancement of photocatalytic performances are emphasized. In addition, computational studies are introduced to deepen the understanding of reaction pathways. At last, perspectives are provided on the development of p-NRR catalysts.