Dear Student
Magnetic field lines more crowded near poles of a magnet because magnetic field strength is maximum at poles. Magnetic field lines are denser at places where magnetic field strength is more and are far away where magnetic field strength is less.
Regards