A plant flowers in order to set seed. Once it succeeds, it slows or stops, because the job is done. Deadheading removes that signal and keeps the plant trying, which is why it extends flowering more than anything else you can do.
How it works
Seed production takes a great deal of energy. Removing the developing seed head redirects that energy into new growth and new flower buds.
On repeat-flowering plants this produces a second and third flush. On annuals it can extend the season from six weeks to five months.
Where to cut
This varies by plant type and it matters.
Roses and shrubs: cut back to a strong outward-facing bud, usually the first or second leaf below the flower. Snapping the head off leaves a bare stalk that dies back.
Perennials with flowers on leafy stems, such as delphiniums and lupins: cut the whole spike down to a strong side shoot or to the base.
Perennials with flowers on bare stems, such as hostas, hellebores and agapanthus: remove the whole stem at the base.
Annuals and bedding: pinch or snip back to a leaf joint.
Bulbs: cut the stem below the developing seed pod, leaving all the foliage.
Clusters and trusses, as on floribunda roses and hydrangeas: remove individual spent flowers as they fade, then cut the whole truss once most has gone over.
Cutting back for a second flush
Some perennials respond to being cut down entirely rather than deadheaded individually.
Hardy geraniums, nepeta, alchemilla and lady's mantle can be sheared to the ground after their first flush. They produce fresh foliage within three weeks and often a second flowering.
Delphiniums and lupins cut down after flowering frequently produce a smaller second spike.
Feed and water after cutting back, since you are asking for a second season's growth.
What not to deadhead
Anything grown for hips, berries or seedheads. Roses producing hips, alliums, honesty, teasel, poppies, nigella and ornamental grasses all contribute more by being left.
Plants you want to self-seed: foxgloves, forget-me-nots, calendula, nigella, hellebores and aquilegia will populate a border themselves if allowed.
Once-flowering plants that will not repeat regardless: most ramblers, species roses and many old garden roses.
Self-cleaning bedding such as many calibrachoa, bidens, bacopa and some trailing petunias, which drop their own spent flowers.
When to stop
Stop deadheading roses and shrubs around the end of September or early October.
Two reasons: letting hips and seed form signals the plant to stop producing soft new growth that frost would damage, and the hips and seedheads themselves feed birds and look good through winter.
Leaving seedheads for winter
The case for not tidying everything in autumn is strong.
Seedheads of hylotelephium, echinacea, eryngium, teasel and grasses hold structure through winter, look superb under frost, feed birds and shelter overwintering insects in hollow stems.
Cut them down in late February instead, which costs nothing and gives four months of interest.
Doing it efficiently
Go over plants every few days through the season rather than as a monthly job. Little and often takes less total time and keeps the plant producing continuously.
Carry a bucket and drop the spent heads into it rather than onto the soil, where fallen material harbours disease.
Cutting flowers for the house is deadheading in advance and has exactly the same effect on the plant.
What deadheading will not fix
A plant that has stopped flowering because it is in too much shade, short of water, overfed with nitrogen or simply a once-flowering variety will not respond.
Check those before assuming more deadheading is the answer, since most flowering plants need at least four to six hours of direct sun to perform.
Feeding alongside
A plant producing repeated flushes is working hard, and a high-potassium feed supports it. Deadheading and feeding together produce far more than either alone.
Water matters too, since a plant short of water drops buds regardless of how carefully it has been deadheaded.
Timing through the season
Start as the first flowers fade rather than waiting until the plant looks untidy, since by then seed is already forming and the signal has been sent.
Petunias, pansies, violas, marigolds and antirrhinum all need going over every few days at the height of the season.