White light is made of a combination of different frequencies of light. The frequency is the distinctive characteristic of each color.
As a wave of a certain frequency travels at a certain speed, it will have a wavelength that is (speed/frequency). When a wave changes speed (by going into a new medium) the frequency stays the same, but it will have a different wavelength.
Different frequencies travel through transparent materials at slightly different speeds. This is due to smaller wavelengths (higher frequencies) interact more often with smaller particles within the material.
Since the angle of refraction depends on the ratio of speeds inside and outside the material, different colors of light will refract at slightly different angles.
This is using the "wave model of light" as an explanation which is rather unsatisfactory when studying higher levels of Physics. The "more correct" explanation is known as "quantum electrodynamics" or QED. You can study this as you get your Master's degree.