Map from Google - Portugal

The climate of Portugal is temperate, being influenced by the Atlantic Ocean. In the north, the climate is cool and rainy, while moving south it becomes gradually warmer and sunnier; in the far south, the region of Algarve has a dry and sunny microclimate. In the interior, on the border with Spain, the climate becomes a little more continental.
In summer, Portugal is protected by the Azores High, so it's sunny everywhere, however, a few weather fronts can pass in the northern part of the country. In the rest of the year, and especially from November to March, there is no shortage of rainfall, which is more frequent and abundant in the north. Therefore, the landscape in the north is very green, while it gradually becomes more arid towards the south, down to Algarve, which has a fairly dry climate.
In fact, annual precipitation exceeds 1,200 millimetres (47 inches) in Porto, while it drops to around 700 mm (27.5 in) in the central area (see Lisbon), and to about 500 mm (20 in) in the south (see Faro). The rainiest season is winter.
Here is the average precipitation in the capital, Lisbon.
Average precipitation - Lisbon
LisbonJanFebMarAprMayJunJulAugSepOctNovDecYear
LisbonJFMAMJJASONDY
Prec. (mm)1101107555451555306095105710
Prec.(in)4.34.332.21.80.60.20.21.22.43.74.128
Days11118772114791179

And here are the average temperatures in Lisbon.
Average temperatures - Lisbon
LisbonJanFebMarAprMayJunJulAugSepOctNovDec
LisbonJFMAMJJASOND
Min (°C)8911121417181918151210
Max (°C)151619202226282827231815
Min (°F)464852545763646664595450
Max (°F)596166687279828281736459

Winter, from December to February, is mild on the coast, even in the northern part, since the average temperature in January goes from 9 °C (48 °F) in Porto, to 11 °C (52 °F) in Lisbon, to 12 °C (53.5 °F) in Faro.
In winter, there are periods of good weather, because the Azores Anticyclone can move over the country even in this season, but there are also waves of bad weather, with rain and wind. Sometimes, gale force winds may blow from the ocean, especially in the north.
The position of the country, overlooking the ocean, provides good shelter from cold winds and night frosts, which in fact are very rare and not intense: the coldest records are around -1/-2 °C (28/30 °F).
In the interior, winter becomes colder, not only for the greater distance to the sea, but also because the altitude increases, and this happens especially in the central and northern regions, east of Coimbra and Oporto (see Bragança), where at times it can snow.
Fatima is located north of Lisbon, about 30 km (18 mi) away from the sea, so it still receives its tempering influence, but it's located at 300 metres (1,000 feet) above sea level, therefore it's slightly colder in winter, while it is equally warm and sunny in summer, with highs around 27/28 °C (81/82 °F).
Here are the average temperatures of Porto.
Average temperatures - Porto
PortoJanFebMarAprMayJunJulAugSepOctNovDec
PortoJFMAMJJASOND
Min (°C)558911131515141185
Max (°C)131416182023252524211714
Min (°F)414146485255595957524641
Max (°F)555761646873777775706357

Summer, from June to mid-September, is sunny, and it's warm in the centre and south, and even cool on the northern coast: in Porto the daily average in July is 20 °C (68 °F), and daytime temperatures are around 24/25 °C (75/77 °F). In Lisbon, the average in summer is higher, and reaches 23.5 °C (74.5 °F) in August, with highs around 28 °C (82 °F). Along the southern coasts, temperatures remain similar to those of Lisbon, because of the influence of the ocean.
The heat becomes more intense in inland areas, particularly in the south-central, in plains and valleys at low altitudes (see Evora), where sometimes it can be torrid.

Lisbon

The temperature of the sea in the northern part of the coast is always very cool, if not cold, and reaches 19 °C (66 °F) in August.
Sea temperature - Porto
PortoJanFebMarAprMayJunJulAugSepOctNovDec
PortoJFMAMJJASOND
Sea (°C)141414141517181918171615
Sea (°F)575757575963646664636159

In the centre (see Lisbon), the temperature of the sea is similar, just warmer, although it's still very cool for swimming, reaching 20 °C (68 °F) in July and August. In the south (see Faro) the sea is still cool, but it's a bit better for swimming, because it reaches 21 °C (70 °F) in August and September.
Sea temperature - Faro
FaroJanFebMarAprMayJunJulAugSepOctNovDec
FaroJFMAMJJASOND
Sea (°C)161516161719202121201817
Sea (°F)615961616366687070686463

When to go

The best months to visit Portugal are May, June and September, because in July and August it can sometimes be hot. However, the north (see Porto) can be visited from June to September, because hot days are rare even in mid-summer.
Winter is mild, but it can be very rainy and windy, especially in the north, and it can be cold in inland areas. Summer is generally not too hot, except during the brief periods of hot winds from Africa, when the temperatures can exceed 35 °C (95 °F), especially in the centre and south.
For swimming and sunbathing, the best months are those of summer, especially July and August (or even the first half of September in the centre and south), however, as mentioned the temperature of the ocean is not high, and on the north coast it's definitely cool.

What to pack

In winter: for Lisbon and the south coast, spring/autumn clothes, sweater, coat, rain jacket; a jacket bit heavier and a hat for Porto and the northern coast. For inland and mountainous areas: warm clothes, down jacket, hat, raincoat or umbrella.
In summer: light clothes, sun hat, a light scarf for the sea breeze, a sweatshirt for the evening; sweatshirt and light jacket for the north and the mountains.