From the website of the Royal Horticultural Society:
"Lavenders should be pruned every year to keep them compact. On established plants use secateurs to remove flower stalks and about 2.5cm (1in) of the current year’s growth, making sure that some green growth remains. At Wisley, pruning is undertaken in late summer after flowering, although spring pruning is sometimes recommended in books. Lavender does not break readily from old wood and neglected specimens are best replaced"
https://www.rhs.org.uk/advice/profile?pid=127