The stretch reflex (also called the myotatic reflex) is a muscle contraction in order to response with the stretching within the muscle. This is a neuron mechanism that responds to a muscle being stretch by attempting to resist a stretch. It regulates the skeletal muscle length.
There are group of cells in the muscle called the spindle muscles that are sensitive with the stretching of a muscle. When a muscle stretches or lengthens, the muscle spindle stretches as well. The stretching of the muscle spindle sends signals to the spinal cord that will eventually send signal to contract the muscles.
An example of this is the ability of the body to maintain our posture when standing for long periods of time. During those long periods of time standing, the muscles may relax by leaning to one side or other. This changes the length of the muscle spindle thus activating the stretch reflex that will signal the spinal cord and eventually returning the body back to the correct position without consciousness.