Porto Cervo is a strictly seasonal resort. The town effectively wakes up in late May and shuts down in late September; outside that window most hotels, restaurants, and shops close and the place feels abandoned.
June and early September are the best windows: the weather is reliably warm, the water is swimmable, and the resort is busy without being heaving. July and August are at full tilt — the marina fills with superyachts, the prices are at their absolute peak, and the beaches are crowded by mid-morning. The middle two weeks of August around Ferragosto are the most extreme, when much of Italy decamps to the coast and Porto Cervo's prices become genuinely eye-watering.
If you want the scenery without the crowds, late September is wonderful — the sea is still warm, the macchia is starting to turn, and you can usually get a beach to yourself. The Maxi Yacht Rolex Cup in early September is the most interesting event of the year for the sailing-minded.