Porto, where it's located

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.
Porto - Average temperatures
Min (°C)558911131515141185
Max (°C)131416182023252524211714
Min (°F)414146485255595957524641
Max (°F)555761646873777775706357

The rains are quite abundant, in fact they amount to 1,150 millimeters (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.
Porto - Average precipitation

The wind blows frequently: in the cold half-year it's caused by 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, which last a few days, and may be abundant. Compared to Lisbon, here cold days, with lows around freezing, are more likely, while snow is rarely seen. In January 1985, the temperature dropped to -2 °C (28 °F).

Spring, from March to May, is cool; episodes of bad weather and wind are still quite frequent, but there are 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 highs around 20/23 °C (68/73 °F) and sometimes even lower in June, and warmer periods, with temperatures hovering between 26 °C and 30 °C (79 and 86 °F). Heat waves are rarer than in central and southern Portugal; however, sometimes the temperature can reach 38/39 °C (100/102 °F) for a couple of days, as happened in both June and August 2003, or in July 2013. In summer, the weather is usually good, but some Atlantic 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.

Porto, Ribeira

The amount of sunshine in Porto is very good in summer, when sunny days prevail (though a little less than in central and southern Portugal); it is also good in spring and early autumn, while from November to March, Atlantic depressions able to bring wind and rain are frequent, although there are also sunny days.
Porto - Sunshine

The ocean near Porto is cold to swim in: the water temperature reaches 18 °C (64 °F) in July and September, and 19 °C (66 °F) in August. Here are the average sea temperatures.
Porto - Sea temperature
Temp (°C)141414141517181918171615
Temp (°F)575757575963646664636159

Best Time

The best time to visit Porto runs from June to September, since it is the warmest and the 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, in September the rains are still quite rare too. 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.