Spanish is the official language of Panama and 14% speak English. Many Panamanians are bilingual.
If you cross the border from Costa Rica into Panama, you will notice a large change in the dialect. True to its Caribbean orientation, Panamanian Spanish sounds much closer to Puerto Rican than Tico or Nicaraguan Spanish. For students of Mexican or European Spanish, it may take a little getting used to. However, it is very easy to understand and it is by no means more difficult than other Spanish-speaking countries. Panamanians tend to pronounce "h" instead of "s" and to not pronounce certain D's at the end of certain words. It is part of their dialect but Panamanians are fully capable of speaking Spanish in a manner more intelligible to students of Mexican or Castillian Spanish, and they are aware of their regional idiosyncrasies.
Panama City has a different dialect in which they mix English words with Spanish. Although educated Panamanians try to speak proper Spanish, they are very proud of their dialect and would rather use it unless it is a formal conversation or public speaking.
Panama has a lot more indigenous culture than some neighboring countries. In Kuna Yala you will hear the native Kuna language spoken. In the Ngöbe-Buglé Comarca, as well as in Chiriqui or Bocas del Toro, you might hear the native Ngöbe-Buglé (Guaymí) language, although the Ngöbe and the Buglé are very quiet around foreigners. If you ask directions from one of them, you will probably just get a hand or lips pointed wordlessly in the right direction.
Much of the Caribbean Coast of Panama was settled by people from Jamaica and Barbados. More recently, the descendants of those settlers seem to be speaking more Spanish, but a lot of them still speak English, albeit a very Caribbean variety, called Guari Guari.
Until only a few years ago, the canal was controlled by the USA. The US has given the canal back to Panama, but many people in Panama City and other areas near the canal still speak English as a first or second language. Surprisingly, English is not as common as you would think for how long the Americans spent in the country. It's not so common for people working in shops or people in the street to speak English. There are a number of English News and Blog sites to help with your travels.