I only visited Porto on a day-trip while staying up north near
Barcelos. Although it's definitely an interesting place, I think two nights
could be enough. Maybe three if you're spending much time in museums or
exhibitions - I mean for Porto alone.
Depending on the season of your travel, I would spend more time in the Douro valley. Remember that this valley is a very hot and humid place (much harder to bear than the hot and dry southern regions)in July and August, while it's perfect in side seasons,and very cold in winter. This peculiar micro-climate is what gives us the Port wine. Harvest is held from late September/early October on. If you only have three nights for Porto AND the Douro, my advice is to skip the Douro valley since hurrying up and down the Douro in a day, especially by car, is not a good idea This place deserves a quiet, slow pace, ideally by train and/or boat. Ciao, Leonardo from Italy