Whenever a ray of light traveling through a medium of refractive #n_1 # enters a medium of refractive #n_2#, it is refracted as per laws of Refraction. On its onward path it emerges out and is back in to the first medium, it is once again refracted. Path of the ray is deviated from its original path.
This total angle of change from initial path, due to refraction, is called deviation.
For example consider the figure below
A ray of light is incident on one of the faces of a prism and enters it. Angle of incidence is #theta_1# and angle of refraction is #theta_2#. The ray of light travels through the prism and hits its opposite side at an angle of incidence #theta_3#. As it emerges out it is refracted once again and now the angle of refraction is #theta_4#.
Let us extend original direction of ray and also extend backwards the deviated direction of the ray. #angle delta# as shown is deviation.