In terms of definitions, we can differentiate the two types of images as follows: a real image is one that can be projected and captured on a screen; on the other hand, a virtual image is one that cannot be projected on a screen.
Conceptually speaking, any image can be made when two or more light rays intersect with one another. In that regard, a real image is made when a minimum of two real light rays intersect to produce a projectable image on a screen; this happens when light rays converge after reflection or refraction. On the contrary, a virtual image is made when a minimum of two virtual light rays intersect instead, which occurs when light rays diverge after reflection or refraction.
Illustrating the two cases through refraction makes the theoretical difference a lot more clear: