A visit of 2 to 3 days would allow you to explore Cardiff's main attractions and get a good sense of the city's culture and history. This timeframe should give you enough time to visit landmarks like Cardiff Castle, stroll around the bay area, and enjoy some of the city's museums, shops, and restaurants.