Map from Google - Costa_Rica

The climate in Costa Rica is tropical hot all year round in the plains and along the coasts, while it's mild in the cities located in the plateau and the mountain slopes (tierras templadas). The Pacific coast and the plateau have a dry season (December to April), and a rainy season (May to November) in which rainfall is abundant, while the eastern plain and coast have an equatorial climate, with abundant rainfall throughout the year.
The temperature variations are low, because the country is located near the Equator, so the main difference is related to the rains. Anyway, the majority of the country is so rainy that it's covered by rainforests.

San José

The capital city of San José is located in the central part, at 3,600 feet above sea leverl, on a plateau (the Central Valley, between the Cordillera Central and the Cordillera de Talamanca), and thus has a pleasant temperature throughout the year, with cool nights and warm days. There is little rain from December to March, and it almost never rains in January and February. The rainy season runs from May to November, and the wettest months are September and October, with around 12 inches per month. The amount of sunshine is good in the dry period, but only mediocre during the rainy season, when the sky is often cloudy.
Here are the average temperatures of San José.
Average temperatures - San José
San JoséJanFebMarAprMayJunJulAugSepOctNovDec
Min (°F)575759636363636161616157
Max (°F)757579798179777979777775

On the Pacific coast, the rainfall pattern is similar to that of San José and the plateau, although of course the temperature is higher. The Pacific coast is even slightly warmer than the Caribbean coast, especially in winter, when the north-east trade winds descend from the mountains and become hot and dry: the average daytime temperatures are around the 86/90 °F in the least hot period, from October to November, and can reach 93/94 °F in March-April, before the rainy season.
The least rainy area of the country, where the savannah dominates, is the north-west (Province of Guanacaste), where the average rainfall drops to 50/60 inches per year.
Here is the average precipitation in Puntarenas, located in the southern part of the Pacific Coast.
Average precipitation - Puntarenas
Prec. (in)

Here the heat is intense throughout the year, and from February to May is torrid in inland areas, with highs around 100 °F.
Average temperatures - Puntarenas
Min (°F)727273757575737373737372
Max (°F)939393959190909090909090

The east coast and the plain overlooking the Caribbean Sea (see Puerto Limón) is rain-soaked, with more than 120 inches per year; here the climate can be defined equatorial, that is without a dry seasons, however, there are two peaks, July and December with about 17 inches per month, and two relative minima in September-October and February-March, both with about 6/8 inches of rain per month. In this area, December is even the wettest month, and January is wetter than February and March. South of this coast, on the mountain slopes of the Braulio Carrillo National Park, precipitation reach 200 inches per year!
Here is the average precipitation in of Puerto Limón.
Average precipitation - Limón
Prec. (in)129.17.710.612.811.817.312.45.78.51517.7140.4

Along the coast of the Caribbean Sea, the temperatures are a bit lower than on the Pacific coast, as the winds blow constantly from the sea, but for the same reason the humidity is higher. Here are the average temperatures of Puerto Limón.
Average temperatures - Limón
Min (°F)707070727373737272727270
Max (°F)848486868886868688868684

The sea in Costa Rica is warm all year round, as we can see in the following table.
Sea temperature - Quepos
Sea (°F)828284848484848482828282

At high altitude, on the slopes of mountains and volcanoes such as Cerro Chirripó, 12,533 feet high, or the Volcan Irazú, 11,260 feet high, the temperature is low, especially in the winter months. Above 11,500 feet, at night it can freeze throughout the year.

Costa Rica is almost always spared from hurricanes, whose path is usually located north of the country, in fact sometimes they can affect the near Nicaragua; therefore the area most at risk is the northern one. The hurricane season runs from June to November, during the rainy season, which in any case is generally not recommended for tourists.

When to go

The best time to visit Costa Rica, either for swimming or for exploring its nature, rich in flora and fauna, runs from January to mid-April, and in particular the months of February and March. It's hot in the lowlands, the sun shines and there's little rain, except on the east coast, which has we said is rainy throughout the year. The capital can be visited even in December.
To avoid the uncomfortable heat of spring, the province of Guanacaste can be visited in December and January.

What to pack

For San José and tierras templadas: all year round, light clothing, a sweatshirt or sweater for the evening; raincoat or umbrella from May to November.
For plains and coasts: lightweight clothes; in the rainy season, a light sweatshirt and a light raincoat for thunderstorms.
For the high mountains: warm clothes, jacket, hiking boots.