The best time to travel to Panama greatly depends on which destination you want to visit and for what particular activities. it could be tourism, or cruising. Best tourist time to visit Panama is between December-March when the weather is fairly pleasant and less humid. But this is the peak tourist season that can be expensivem though not unaffordable as Panama is generally a reasonal travel destination anytime of the year. But if you are looking for cheaper fare and deals, opt for either off-season periods or shoulder periods. Shoulder periods refer to the time just after the peak tourist season, this will be from late November-early december and May:) almost 6 years ago
I was in Panama (Panama City, Bocas del Toro, Pearl Islands) in May/June 2013 and found it a good time to visit - not too busy, easy to get accommodations, lower prices than high seasons. Some restaurants were closed as owners took their holidays. It was pretty hot and humid, and a few days had torrential rain for an hour or so. Nothing that can't be dealt with though.
I'd be happy to answer any specific questions. about 4 years ago