The invention relates to polyimide aerogel and a preparation method thereof, and in particular relates to polyimide aerogel with crosslinked surface functionalized nanoparticles and a preparation method thereof. The preparation method of the aerogel comprises the following steps: functionalizing surfaces of the nanoparticles; synthesizing a polyamide acid precursor; preparing polyimide wet gel by adopting functionalized nanoparticles as a crosslinking agent; and carrying out supercritical drying, so that the crosslinked polyimide aerogel is obtained. The polyimide aerogel provided by the invention has a stable and narrowly distributed mesoporous structure and is large in specific surface area, good in heat resistance and stable in physicochemical properties, and different performance characteristics, including better toughness, rigidity, heat insulation property, dielectric property, conductivity, electromagnetic shielding property and the like, can be given to the aerogel, so that the polyimide aerogel can further serve as a polymer electrode material, an adsorption catalysis carrier, a porous thermal insulation material, an electromagnetic shielding material and the like.