The invention relates to the field of gasoline and diesel oil hydrodesulfurization catalysts, and provides a preparation method of an ultra-deep gasoline and diesel oil hydrodesulfurization catalyst,which comprises the following steps: by using a nitrogen-doped carbon material as a carrier, attaching an active component to the carrier by an impregnation method, performing drying and roasting to obtain the ultra-deep gasoline and diesel oil hydrodesulfurization catalyst, wherein the active component comprises a metal salt and an auxiliary metal salt. According to the invention, a nitrogen-doped carbon material is used as a carrier, and a traditional Co (Ni)-Mo (W) metal active phase is loaded to prepare the novel catalyst; compared with a Co (Ni)-Mo (W) hydrogenation catalyst commonly usedin the industry, the catalyst has the advantages that a nitrogen-doped carbon material formed by introducing N atoms with high charges and spin density into a carbon material has excellent electron donating characteristics, and the electron and morphology structures of a metal active phase can be effectively regulated and controlled through the anchoring effect and the electron donating effect, therefore, the catalyst has higher gasoline and diesel hydrogenation activity and desulfurization effect, and better reserves the octane number of gasoline.