White light consists of seven colors and each color has its distinct wavelength, red color having highest wavelength and violet having the least. When a white light passes through a prism different color component gets dispersed because different component faces different refractive indices.
Refractive index of material is inversely proportional to the wavelength of the light.