Map from Google - Tunisia

In Tunisia the climate is Mediterranean on the northern coast, with mild, rainy winters and hot, sunny summers, while it is semi-desert and desert in the inland areas. The east coast, from the Gulf of Hammamet towards the south, receives little rainfall, and in the south becomes progressively less rainy, until it becomes desert in the southernmost part (from the Gulf of Gabès to the border with Libya), but the temperatures along the coast remain Mediterranean-like, with highs around 61/64 °F in winter, and around 88/90 °F in summer.

Tunis, the capital, is located in the northern part of the coast, where the weather fronts of Mediterranean or Atlantic origin pass more frequently in the winter months.
Here are the average temperatures of Tunis.
Average temperatures - Tunis
TunisJanFebMarAprMayJunJulAugSepOctNovDec
TunisJFMAMJJASOND
Min (°F)454546505763687066615246
Max (°F)616364707784919186777063

The rains have a Mediterranean pattern on the coast, so that they are more abundant in late autumn and winter, and become very rare in late spring and summer. They are most abundant in the northern coast: in Tunis, precipitation amounts to 20.5 inches per year, most of which occur from October to April, while in summer it hardly ever rains; in Bizerte, in the far north, the rains are a bit more abundant, around 22.5 inches per year.
Here is the average precipitation in Tunis.
Average precipitation - Tunis
TunisJanFebMarAprMayJunJulAugSepOctNovDecYear
TunisJFMAMJJASONDY
Prec. (in)2.62.62.21.810.40.20.41.42.82.4320.5
Days88875312577869

Precipitation decreases to 12/15.5 inches per year in the Gulf of Hammamet, and about 8 inches in the Gulf of Gabès.
Here is the average rainfall in Sousse, in the southern part of the Gulf of Hammamet.
Average precipitation - Sousse
SousseJanFebMarAprMayJunJulAugSepOctNovDecYear
SousseJFMAMJJASONDY
Prec. (in)1.41.21.21.20.60.40.20.41.42.21.41.813
Days66654212465653

In the northwest, there are hilly and mountainous areas (Tunisian Dorsale or High Tell, and Tebessa Mountains), which in winter are cold and may even experience snowfalls, while in summer they are hot during the day, but remains quite cool at night.
Here are the average temperatures of Kasserine, located at 2,200 feet above sea level.
Average temperatures - Kasserine
KasserineJanFebMarAprMayJunJulAugSepOctNovDec
KasserineJFMAMJJASOND
Min (°F)343637435259646457504137
Max (°F)525459667788959382726155

Kasserine is located at the foot of Jebel ech Chambi, the highest mountain in Tunisia, 5,066 feet high.

In the desert, the summer heat is remarkable: the maximum temperature reaches on average 99 °F in Gafsa in July and August, and 102 °F in Tozeur. In the desert, the daily temperature range is wider than on the coast, so that in winter, the night-time temperatures can drop a few degrees below freezing, while in summer the highest recorded temperatures are about 125 °F in the southern part of the desert.
Here are the average temperatures of Tozeur, located in the desert, west of Gabès.
Average temperatures - Tozeur
TozeurJanFebMarAprMayJunJulAugSepOctNovDec
TozeurJFMAMJJASOND
Min (°F)454652576472777772635245
Max (°F)63667279889710210293827263

The rains in the desert region are scarce throughout the year, but they are even scarcer in summer, when there are very few showers. Here ais the average rainfall in Tozeur.
Average precipitation - Tozeur
TozeurJanFebMarAprMayJunJulAugSepOctNovDecYear
TozeurJFMAMJJASONDY
Prec. (in)0.60.60.80.60.40.200.20.60.60.80.66.1
Days43232201323429

In the desert area, there is the also a large salt lake, Chott el-Jerid, almost entirely dry, witness of a past when the climate was more humid. The few remaining waterholes have different colors, depending on the salt which prevails in each of them, offering an unusual sight.

The coastal and mountainous regions of Tunisia may be affected by the desert wind, which raises the temperature by several degrees but also a drop in relative humidity, and may cause even sandstorms. During these periods, the peaks of heat are remarkable, especially from June to September, when the temperature can exceed 105 °F in Tunis and along the east coast.
In the south, the islands of Djerba and Kerkennah have a mild climate, but they are also subject to the torrid wind from the desert.
Average temperatures - Djerba
DjerbaJanFebMarAprMayJunJulAugSepOctNovDec
DjerbaJFMAMJJASOND
Min (°F)484852556168727370645550
Max (°F)616468727984909186797264

The amount of sunshine in Tunisia is very good throughout the year on the east and south coast and in inland areas, while on the northern coast, from October to April, there's no shortage of sunny days, which, however, alternate with cloudy and rainy periods which last for a few days.

Monastir

In the northern part of the coast, the sea is warm enough for swimming from July to September, while it is definitely cool, if not cold, from December to May.
Sea temperature - Tunis
TunisJanFebMarAprMayJunJulAugSepOctNovDec
TunisJFMAMJJASOND
Sea (°F)595959596370757977726663

In the southern part of the coast, the trend is similar, although the sea is slightly warmer, and remains warm still in October.
Sea temperature - Djerba
DjerbaJanFebMarAprMayJunJulAugSepOctNovDec
DjerbaJFMAMJJASOND
Sea (°F)615961636672798281777264

When to go

To visit Tunis and the northern coast, and also the northern hills and mountains, you can choose spring and autumn (April, May and October).

For a beach vacation, you can go from June to September. The favorable season for a beach vacation is quite long, especially in the east coast, which is usually sheltered from the Atlantic disturbances, so that it can easily last until mid-October.

The desert can be visited in winter, or when the maximum temperatures are normally below 85 °F, ie from November to March. In winter, the days are mild and the sun usually shines, while at night it can get cold.
Summer is not the best season to visit the Tunisian desert, because of the scorching heat. In the desert, there are hotels with swimming pools, but in summer the heat is so intense that even sunbathing can be difficult. A compromise between excursions in the desert and relaxing moments at the pool could be found in spring and autumn, ie in April and October. On the contrary, as mentioned, the coast is good for a beach vacation in summer.

What to pack

In winter: for Tunis and the coast, spring/autumn clothes, a jacket and a sweater, raincoat or umbrella; for the mountain areas, warm clothes and down jacket; for the desert, light clothing, but also sweater and jacket for the evening, scarf for the wind-borne sand and dust.

In summer: for the coast, lightweight clothes, light scarf for the sea breeze, light sweatshirt for the evening. For the desert, loose fitting clothes, made of natural fabric (cotton or linen), desert turban for the wind-borne sand and dust; sunglasses (even graduated instead of contact lenses); a sweatshirt for the evening or the mountains, sweater or sweatshirt and sleeping bag for overnight stays outside; hiking boots or sandals.
For women, it is best to avoid shorts and miniskirts, especially in rural and non-tourist areas.