Refraction: light changes direction of propagation when entering a material with a different refractive index.
Does the direction of propagation of light change sharply and almost instantaneously (as shown in the diagram) or smoothly?
I don't understand the down vote on the OP. In order for Snell's Law ($n_1 \sin{\theta_1} = n_2\sin{\theta_2}$) to be valid, certain conditions have to be met. Usually we assume the conditions are met, and draw the simple diagrams such as yours. These represent idealizations of real situations. For example, the ideal interface is discrete, changes abruptly, and is perfectly flat, and the materials are homogenous. At a microscopic level, all real interfaces consist of meetings of molecules, so are not discrete, abrupt, nor flat, and materials are not homogeneous (they are made of atoms and molecules).
However, from a macroscopic perspective, if we don't focus attention on the microscopic, the interfaces sure look discrete, abrupt, and flat, and the material homogenous. So we expect Snell's Law to work macroscopically ... as long as we don't look too close to the surface, or too closely at the molecules. And indeed, it does work. In particular, in the idealization the direction of the ray changes abruptly. Macroscopically, if we don't look too close to the surface, it does.
But your question is, really: what happens if we don't take that macroscopic view? Does the ray curve smoothly rather than abruptly change direction?
I doesn't bend. What actually happens is very complicated. I think there are two ways to look at it. In the first, the original rays spawn countless other rays in the interface region, pointing in all directions. Once we focus attention away from the interface region we find that almost all of those rays have destructively interfered, all except those that go off in the macroscopic refraction direction. Another way to look at it is to say that a ray represents a "pencil" of light having a well-defined wavelength and direction. Then, we recognize that the interface region is too small for us to unambiguously define the wave length. Thus, the concept of "ray" does not exist in the interface region.
In any event, the picture of a smoothly curving ray is not the right picture.
Update
Well, whether or not the picture of a curving ray is correct or not depends on how closely you look, and how deeply you want to probe for an answer.
The comments point out a weakness in my answer. I tried to use the language of rays, as suggested by the diagram. Doing so will always eventually lead to trouble. "Ray" can refer to the propagation vector of a plane wave, or it can refer to a tight pencil of light, usually taken to have zero cross section in our imagination. Both of these pictures are mathematical abstractions that are ultimately non-physical.
I did not make the approximation that materials are actually continuous media. You can make that approximation and show that "rays" are curved, but that is not a correct description of what the electric field looks like in the interface region. In the continuous approximation we average the actual electric field over a volume large compared to the size of an atom, but small compared to a wavelength. One ends up with a (average) dielectric constant that is a continuous function of position. The averaged field is called the macroscopic electric field. But within the volume used to do the averaging, the actual microscopic field is varying wildly. This is why I said that either rays are propagating in all directions, or the concept of "ray" does not exist near the surface.
Let's take a different microscopic view. Light is incident on the interface. We'll model the solid as a distribution of polarizable entities, I'll call them atoms, but they could be molecules. They could be distributed regularly, as a crystal, or randomly as in an amorphous solid. The incoming light excites each dipole. Each excited dipole acts as a source of new radiation. The refracted field is the sum of the radiation of all of these dipoles plus the field of the incident radiation. At an atomic level, the field distribution is very complicated.
One can make further progress by doing the averaging procedure. We get an average field, and the fluctuations are smoothed out. This is about all we can do for the amorphous solid, because we don't know where the dipoles actually are. This results in the continuous approximation, and we predict curved rays. But that does not represent the actual electric field! We've removed much of the character by smoothing out the field.
Things are different for a perfect crystal. Here we do know where the atoms are, and we can can add all the contributions from all of the dipoles. The result, as expected, is a wave which propagates in the refraction direction. In this picture, the fields in the surface region are complicated in the way I mentioned in my original answer, and one can't describe what's going on as curved rays.
Interesting aside: when all of those individual contributions from individual dipoles are added up, we find that actually two waves are generated in the refracted material. The first propagates in the direction of the incident wave, but is out of phase with it, causing the incident wave to vanish by destructive interference. The second wave is the actual refracted wave. This result is known as the Ewald-Oseen extinction theorem.
Generally speaking, it's impossible to physically observe a strictly "sharp" phenomenon in physics (there still some exceptions of course). However one phenomemon can have some characteristic constants which vary much more faster compared to others phenomema.
Here, in the geometrical optics approximation, since you are only interested in what happens far from the interface, it is "ok" to describe a sharp direction change of your ray path.
But if you are zooming to see what is going on close to the interface, the ray path will always experience some gradient of the index of refraction $\nabla n$.
To calculate the ray path through a middle with a gradient of index $\nabla n$, one can use the Fermat's principle, i.e. a ray of light always takes a path with a stationary optical length $S$, so that :
$$\delta S=\delta\int_\mathcal{C}n(s)\,ds=0$$
where $s$ is the curvilinear coordinate along the ray path.
From this principle follows the eikonal equation which is an Euler-Lagrange-like equation for rays path:
$$\frac{d}{ds}\left(n(\mathbf{r})\frac{d\mathbf{r}}{ds}\right)=\frac{\partial n}{\partial\mathbf{r}}$$
where $\mathbf{r}\in\mathbb{R}^3$ are the ray path coordinates.
Solving this equation will give you the curved ray path $\mathbf{r}$ associated to the gradient $\nabla n=\frac{\partial n}{\partial\mathbf{r}}$ that the ray is experiencing for its propagation through the medium.