Map from Google - Porto

In Porto, a city located in the northern part of the coast of Portugal, the climate is temperate oceanic, with mild and rainy winters, and pleasantly warm and sunny summers.
Here are the average temperatures.
Average temperatures - Porto
PortoJanFebMarAprMayJunJulAugSepOctNovDec
PortoJFMAMJJASOND
Min (°C)558911131515141185
Max (°C)131416182023252524211714
Min (°F)414146485255595957524641
Max (°F)555761646873777775706357

The rains are quite abundant, given that they amount to 1,150 millimetres (45 inches) per year; the wettest period is from November to March. From June to September it rains quite rarely, especially in July and August. Here is the average precipitation.
Average precipitation - Porto
PortoJanFebMarAprMayJunJulAugSepOctNovDecYear
PortoJFMAMJJASONDY
Prec. (mm)1601451108585402025501051501701145
Prec. (in)6.35.74.33.33.31.60.8124.15.96.745.1
Days13141099534691213107

The wind blows frequently: in the cold half-year it's related to Atlantic depressions, and can be strong, while in summer a cool breeze from the sea blows in the afternoon.

Winter, from December to February, is mild: daytime temperatures hover around 13/14 °C (55/57 °F). The rains occur in periods of bad weather that last a few days, and may be abundant. Compared to Lisbon, here cold days are more frequent, with lows around freezing (in January 1985 the temperature dropped to -2 °C or 28 °F), while snow is rarely seen.

Spring, from March to May, is cool, with episodes of bad weather and wind still quite frequent, but also sunny periods, with mild temperatures. In May, the maximum temperature is on average about 20 °C (68 °F).

Summer, from June to mid-September, is mild or pleasantly warm depending on period. In fact, there are quite cool periods, with maximum temperatures around 20/23 °C (68/73 °F), and sometimes even less in June, and warmer periods, in which the temperature hovers between 26 °C and 30 °C (79 and 86 °F). Heat waves are rare: sometimes the temperature can reach 38/39 °C (100/102 °F) for a couple of days, as happened in June and August 2003 or in July 2013: therefore, this happens less often than in central and southern Portugal. In summer the weather is usually good, but some weather fronts bringing clouds and rain can not be excluded, especially in June, which to tell the truth often resembles a spring month.

Autumn, from mid-September to November, is mild, and over the weeks becomes gradually wetter, although good weather often continues until mid-October.

The amount of sunshine in Porto is very good in summer, when sunny days prevail; even in spring and early autumn it's good, while from November to March, Atlantic depressions able to bring wind and rain are frequent, although there are also sunny days.

Porto, Ribeira

For swimming, the ocean is cold: the temperature touches 18 °C (64 °F) in July and September, and 19 °C (66 °F) in August. Here are the average sea temperatures.
Sea temperature - Porto
PortoJanFebMarAprMayJunJulAugSepOctNovDec
PortoJFMAMJJASOND
Sea (°C)141414141517181918171615
Sea (°F)575757575963646664636159

When to go

The best time to visit Porto runs from June to September, being the warmest and least rainy of the year. July and August are the warmest months, but the heat is rarely excessive, and in addition they are the least rainy; however, even in September the rains are still quite rare. In May, you can go, but cool and rainy days are more frequent.
Even in the summer it's better to bring a sweatshirt, and maybe a light jacket, for the evening.