Around this time of year, my petunias used to start to look a bit leggy. A few years back I discovered the secret to prolonging the life and beauty of my petunias by employing a little tough love.
This is how you do it: You cut them off, blooms and all, to about 2" to 3" from the ground/dirt.
Then, after you've given them their haircut, douse them with a mix of water and an all-purpose, water-soluble plant food, like Miracle Gro (the blue crystal stuff), or, if you'd rather go the organic route, you might want to try Flower-tone. Continue the feeding recommendations on the plant food's box for the rest of the summer.
Below is a planter that I trimmed up about two weeks ago. As of right now, it has 17 new blossoms and is on its way back to gorgeous. The first summer I did this to my petunias, I was getting comments well into September from my neighbors saying how beautiful they looked so late in the season as theirs had been trashed weeks earlier. Totally worth the tough love. By the way, the technique will work for other annuals too like geraniums, which can also start to suffer from a case of the leggies around this time of year.