Dubrovnik is one of the few places where the postcard is accurate. A ring of limestone walls, 1,940 meters long and up to 25 meters high, closes around red roofs and a single marble street. It was the capital of the Republic of Ragusa, a merchant state that ran itself until 1808, when French rule ended it. Then came the 1667 earthquake, which killed more than 5,000 people, and the siege of 1991-92, when a UNESCO team counted more than half of the Old Town's buildings damaged. What you walk through now was rebuilt twice.
The honest part is the crowds. The Old Town is tiny, the cruise terminal is in Gruž, and the city has tried to cap daily arrivals for years (the details are in the tips). Dubrovnik is far better in the shoulder months and in winter, when you can walk the walls with few people around. Five days is the right length: three for the city itself, which is more than the walls and Stradun, and two for the trips that make the region worth it. Game of Thrones used the Old Town as King's Landing, and you'll see where, but the show is the least interesting thing about the place.
The plan runs by geography. Day one is the walls, the monastery, Stradun and the palaces inside the walls. Day two is Fort Lovrijenac and the island of Lokrum. Day three is Mount Srđ, the beaches and the bars cut into the rock. Day four is a trip to Ston for the walls, oysters and Pelješac wine, and day five is Cavtat, the easy one. Start on a Tuesday: the Rector's Palace is closed on Mondays in winter. If you have longer, the rest of Croatia starts a coach ride away.