Lavender flowers should be harvested just before the blooms open. The flowers will look like fat, purple seeds on a stem. If you miss and must cut them later, be prepared for the flowers to fall off the stems.
For culinary purposes, it may not be so important that you have perfectly preserved stems of lavender, but they probably lose some of their intensity of aroma as they mature on the plant.
According to most herbals the aromatic powers of herbs are strongest when the plant has not yet opened to full bloom (true of most all the blooming herbs), and to cut herbs in the morning when the plants are perfectly dry. If you live in an area where there is a lot of morning dew, the dryness is probably more important than the morning hour.
Cut the lavender stems as long as you are able. If you want to use some
of your harvest for gifts or crafts, the long stems are most lovely. They
also increase the possibilities available to you (you cannot make lavender
bottles with short stems).