I am a U.S. passport holder, I arrived in Panama on April 12th. How long can I legally stay and how long do I have to leave before I can come back in the country legally?
You can stay for exactly 180 days, inclusive of the day of arrival. This means you need to leave by 23:59 on October 8th, 2016. In theory, you can leave and immediately come back, but you'd have to prove you're not trying to live in Panama on a tourist visa.