Most people treat Bari as a place to land. The airport is the way into Puglia, the station has trains to the trulli and the coast, and the usual plan is to drop the bags and leave. That's a mistake of about two days. Bari is a working port city of roughly 300,000 people, with a medieval old town on a spur of limestone, a basilica built in the 1080s to house the bones of Saint Nicholas, and a street where women still roll orecchiette by hand outside their front doors. It's also the one city in Puglia where the people you see on the street aren't there for you.
Five days works because Bari is the best base in the region, not because the city needs all five. It takes two days to do properly, one for the old town and one for the 19th-century grid, the theatre and the seafront. The other three go on day trips, and all of them work without a car: the coast train to Polignano a Mare and Monopoli, the Ferrovie del Sud Est train to Alberobello and the Itria Valley, and the FAL train and bus to Matera in neighboring Basilicata. Bari is the base because the three lines leave from one station area and you unpack once. For a slower stay, drop Matera: it's the longest day and the most timetable-bound. Castel del Monte and Ostuni are under more time. Heading further south afterwards, see 5 days in Naples or 5 days in Catania.
The plan runs day by day: the old town and the Basilica, then Murat, the Petruzzelli theatre and the seafront, then Polignano and Monopoli, Alberobello and Locorotondo, and Matera. Start on a Monday. The orecchiette makers and the fish market work their mornings, and none of the day trips falls on a Sunday: FAL runs no trains on Sundays and holidays, only replacement buses. More about the country is on our Italy page.