The invention discloses a NiM-LDH/g-C3N4 composite photocatalytic material and a preparation method thereof. An alcohol-water mixed solvent is utilized, and g-C3N4, nickel salt, transition metal salt,a surfactant and a precipitator are added in the solvothermal treatment process, so that g-C3N4 can be stripped to obtain ultrathin porous g-C3N4, and meanwhile, ultrathin two-dimensional NiM hydrated hydroxide can be generated on the surface of g-C3N4 in situ. The preparation method disclosed by the invention is simple and feasible; good repeatability, safety and reliability; the NiM-LDH/g-C3N4composite photocatalytic material is an ultrathin two-dimensional composite photocatalytic material, which is simple in preparation method, relatively low in cost and high in specific surface area, greatly enhances the photo-induced electron hole separation efficiency and light absorption performance, has relatively high catalytic activity and stability for hydrogen production through visible light catalytic water splitting, and can realize efficient hydrogen production through visible light catalysis.