Alcoholic beverages are sold every day of the week throughout the year, with the exception of the 2 days before Easter and the 2 days before and after a presidential election. The legal drinking age is 18, although it's only sporadically enforced.
Drinking in public is now allowed by law! The fine for drinking in public places can go up to 200,000 CRC (355 USD).
A few years ago Costa Rica passed legislation making it illegal to drink in public except at municipally sponsored and licensed fairs and other events. If you get fined, don’t think you’ll get away with just ignoring the ticket because airport immigration authorities will prevent you from leaving until the citation is paid (same with traffic tickets).
If you’re minding your own business and not otherwise causing a disturbance it’s unlikely the police will notice you’re enjoying a beer with your friends at the BBQ in the park. If they do point out it’s not allowed, they’ll most likely just ask that you put the cooler in the car, but it’s always better not to take the risk.