Ammonia is a carrier of high energy density and a good hydrogen storage substance. The Haber-Bosch process accounts for 90% of the world's ammonia production, which relies on natural gas and fossil resources as energy sources, not only polluting the ecological environment, but also accelerating the consumption of resources. To explore new ways to synthesize ammonia and reduce carbon emissions, electrocatalytic nitrogen reduction reaction (NRR) to produce ammonia has been emerged owing to the advantages of environmental protection, low energy consumption and mild reaction conditions. Here, we systematize the NRR mechanisms, including dissociation mechanism, association mechanism (involving distal pathway, alternative path, and enzymatic mechanism), and Mars-van Krevelen mechanism. Then, theoretical calculations, performance parameters, synthesis methods, and types of NRR electrocatalysts are detailedly introduced. Moreover, effective strategies to optimize the electronic structures of NRR electrocatalysts are emphatically discussed, including d-band center modulation (involving monoatomic dispersion, doping strategy, defect engineering, interface engineering, and strain effect), p-band center modulation, and other regulation strategies (involving construction of heterojunction, electron spin state modulation, phase interface engineering, and lithium ion mediation). Furthermore, we introduce NRR-related cell design and development. In addition, we evaluate relevant NRR experimental techniques, including N adsorption characterization techniques and methods for identification of active sites. Finally, the future challenges and opportunities concerning the improvement of NRR catalysts are outlined.