Depending on age, but the best time is mid to end August, shaping it into a 'heghog' mound, leaving some live growth. It will then re-sprout before the winter to give a nice neat plant thru winter.
I'm with landscaper on this one, I tidy mine after flowering and not too hard. Lavender really needs replacing about every 3 or 4 years, they go a bit too woody & sprawling.
what landscaper has suggested is the best time to do it but not the only time it can be done. It is perfectly possible to do it the way boxtops suggests and still get good results this year. They will flower on fresh, same year foliage so you will still get the flowers.