Panama City's appeal rests on four pillars, and they are close enough together that none requires more than half a day to reach. The Casco Viejo is the old colonial quarter: cobbled streets, restored mansions, plazas with fountains, and the city's best restaurants and bars. The Panama Canal — specifically the Miraflores Locks — is the one sight in Panama that requires no prior enthusiasm for engineering to be genuinely impressive; watching a Panamax container ship rise eighteen metres in a concrete tank while standing a few metres away is one of the more arresting things in the Americas. The Panamá Viejo ruins give you the city's deeper history, the original Spanish settlement abandoned after a pirate raid and left as a park of crumbling stone towers on the eastern edge of the modern city. And then there is the wildlife: the Pipeline Road in Soberanía National Park, thirty minutes from the city centre, is one of the finest birding sites on the planet.
Allow three days minimum. Two days will leave you feeling you missed something; four is better if you add a canal boat trip or a day out to the Pearl Islands.