August is the best time to visit Valley of Flowers. But, July isn't too bad either. Only downside of traveling in July is that rains could lead to landslides which might cause delays. And, it is a bit tougher to do the trek in the rains.
The Valley of Flowers is only open from month of June until the beginning of October, as it's covered in snow the rest of the year. The best time to visit is from mid July to mid August, when the flowers are in full bloom after the first monsoon rain.