To get a well-rounded experience of Portugal, it makes sense to try to visit both places. 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.