The refractive index of a material depends upon the wavelength as the velocity of light in a material depends upon wavelength, since white light is composed of different colours, so different colours are deviated through different angles and we get dispersion of light.