Pain is defined as an unpleasant sensory and emotional experience that is associated with actual or potential tissue damage, or described in terms of such damage.

An experiment was conducted that applied heat (stimulus) to a persons skin and used an electrode to measure the electrical activity in both nociceptors and thermoreceptors. This experiment demonstrated that pain perception requires specialized neurons and not simply a greater discharge of neurons that respond to harmless stimulus intensities (i.e. you need nociceptors to detect pain, thermoreceptors are not able to detect pain regardless of the intensity of the heat).
As the temperature increases slowly, the thermoreceptor responds, with action potentials, to low and moderate heat (below pain threshold, e.g., 40–43°C). After about 45°C, it stops responding, even if heat continues to rise. Nociceptors on the other hand are not active at lower temperatures (because there is no painful stimuli to respond to). These receptors only start firing once the pain threshold is reached (+- 43 degrees) and as the temperature increases beyond this point the number of action potentials being fired will increase indicating increasing pain.
Pain signaling follows the labelled line code, meaning that specific nerve fibers are “labelled “ for pain and thus the brain interprets any signal from them as pain no matter what.
<aside> 💡
If a signal comes from a nociceptor, the brain always interprets it as PAIN, even if it's a wrong or weak signal.
If a signal comes from a thermoreceptor, the brain interprets it as warmth or cold, never pain.
It’s about WHICH system the signal travels through, not necessarily how big or small the signal is. Each sensory neuron type has its own "labelled line" to the brain — and the brain trusts the label blindly.
</aside>
Pain can be classified based on duration and usefulness:
Duration:

An experiment was conducted to decipher which fiber carried which type of pain (fast or slow). Blocking of the A delta fiber was associated with loss of the first/fast pain whereas blocking the C fiber was associated with loss of the slow/second pain.
Usefulness:

Look at bottom two only.