The invention relates to a method for preparing a nitrogen-doped porous carbon material by a two-step method and application thereof, and belongs to the field of hydrogen storage materials and new energy materials. The nitrogen-doped porous carbon material is prepared by adopting a template carbonization method, which comprises that: firstly, a microporous molecular sieve such as ZSM-5, 3A, 5A, 13X, Y, beta and the like is used as a template, and then nitrogen-doped porous carbon material is prepared by adopting the two-step method combining liquid-phase impregnation and chemical precipitation. The liquid-phase impregnation uses sucrose, furfuryl alcohol, polyacrylonitrile and the like as a carbon or carbon-nitrogen precursor which is impregnated in the template, and the chemical precipitation comprises that propylene, acetonitrile, phenyl ethylene, methylbenzene and the like are precipitated on the template by a CVD method in turn. And then, nitrogen-doped porous carbon is further obtained through the process steps such as high temperature carbonization, template removal and the like. The nitrogen-doped porous carbon material with different structures can be obtained by controlling process conditions. The nitrogen-doped porous carbon material prepared by the method has the advantages of high specific surface area, large pore volume, narrow aperture distribution and adjustable pore structure, and can be used for the hydrogen storage materials and super-capacitor electrode materials.