Light travels as waves which have a distinct set of properties: a speed, a frequency and a wavelength. These properties are related to each other through the following equation: speed = frequency * wavelength.
As light rays of a set frequency pass through two different media (air and glass), wave speed will change, due to the change in optical density of the medium that it is passing through. Optical density is a property of media that transmit light which relates these to each other based on the degree to which these retard the transmitted rays of light.
In the instance of these two media, glass can be said to be more optically dense than air, in which case, rays of light will travel at a lower speed when they enter the glass block. As rays of light slow down when they enter the glass block, wave speed decreases, causing wavelength in turn to also decrease. This change in wavelength will cause light to bend towards the normal at the boundary between the two media (glass and air), which is the effect we call refraction.