Ideally, I'd recommend three or four nights in Lisbon (in order to do a day trip to Sintra) and two nights in Porto. On the shortest itinerary I would plan on two nights in each city. Fly into one city and out of the other. It takes three hours to travel between Lisbon and Porto via car or train.