Here is a simple Feynman diagram.
electron electron elastic scattering if time is the y axis,( electron positron elastics scattering if time is the x axis)
Real particles are the incoming and the outgoing that can be measured in an experiment in the lab. The exchanged photon is called virtual.
The difference between real particles and virtual particles in the mathematical definition is that virtual particles are off mass shell, i.e. they have all the quantum numbers identifying the particle by its name, but not the mass which can be positive negative or zero depending on the integration. Real particles except their quantum numbers also have an identifying mass.
This has to be so because the Feynman diagram is a symbolic shorthand for an integration which takes place over all the internal variables identifying the cross section of scattering two electrons into two electrons.
In a very real sense what is real and what is virtual depends on the boundary values of our calculation. In this diagram of electron positron annihilating into two quarks and a gluon
the electron and positron are known on mass shell real particles, the photon is virtual, and in a strict feynman diagram sense since quarks and gluons cannot be free but have to bind with other quarks and gluons, the outgoing should also be considered virtual. There we substitute the concept of a gluon jets two quark jets, which can be well measured in the lab and christen the outgoing three real.
The normal physical law that is violated by virtual particles is the mass shell as explained above. All the other quantities that identify the particles are there , that is why we can have virtual electrons and virtual photons, it is only the mass that is not respected within the bounds of the calculations for the quantities of interest in a physical measurement.
The Heisenberg Uncertainty Principle comes when we contemplate ground states in energy, and there exist diagrams where the vacuum is composed of virtual particles being created and annihilated, because we can never measure zero energy due to the Heisenberg uncertainty. There is nothing that constrains the mass for the HUP, so there is no conflict in describing situations with such virtual particles. There are few situations where the effect of vacuum fluctuations can be measurable, one of them is in the Hawking radiation. Another one is the Casimir Effect.
Edit after comments:
This question about the meaning of "virtual" comes up again and again, and I believe the confusion arises because of the tendency of most of us to mix up three different frameworks:
1) One framework is the symbolic Feynman diagrams,
2) the second is the mathematical framework of integrals within integrals in any cross section etc calculation,
3) and the third is the measurement/physical/laboratory framework.
With great ingenuity Feynman took the complicated integrations in scattering calculations before his "invention" of the diagrams, and made a one to one correspondence of the mathematical framework to a consistent system of diagrams with rules for converting to integration. This simplified enormously setting up the program for calculations .
Then comes the identification of the symbolic plots to the laboratory/measurement framework. This is done by taking the initial values from the experiment under consideration and predicting the values for the outcome of the experiment.
The initial and final states are the ones measured in the lab and nailing the mathematics to reality/experiment, and thus the incoming and outgoing lines in the diagrams are called "real".
The intermediate lines are called virtual particles because they, like a virtual optical image, are an analogue of the real particles because they carry all the quantum numbers of the real particles except the mass, they are off mass shell.
Usually the three frameworks are not logically separated because there is no necessity, there is no problem if one is sloppy on whether one is talking mathematics or diagrams or laboratory measurements. The calculations fit and that it that.
Confusion arises when thinking about the vacuum and about Hawking radiation.
We can draw Feynman diagrams which correspond to the zero point energy with virtual particles without incoming and outgoing lines. The boundary values are given by the Heisenberg Uncetainty principle which is the correspondence with physical reality ( it has not been invalidated as a postulate for the mathematical modeling of elementary particle physics with quantum field theory). Thus we have the three frameworks.
When asking if any real particles can come out, it is a question for the first and second framework, the diagrams and the mathematics calculations associated. The answer there is yes, if energy can be supplied in excess of the HUP uncertainty, and that is what allows the Hawking radiation hypothesis for black holes. It is still in the first two frameworks, a mathematical prediction, until some ingenious experiment will be able to show the radiation coming from a black hole.