On arriving at Porto Airport you will have to allow a minimum of 55 minutes from entering the Metro station until you get to Porto Campanha Station.
You probably will not get there until circa 20:15 at the earliest.
At present the last train for Lisbon leaves Porto Campanha at 20:47 arriving Lisbon Sta Apolonia at 23.30.
I am not sure when you are planning to travel so please check the timetables nearer the time.
You can find a link to the Lisbon to Porto rail timetable on my blog here:
http://barlaventostravelblog.blogspot.com/
Scroll down on the right hand side panel till you come to:
»» Algarve & Portugal - Travel Transport Links
»» Continue scrolling down in this section till you come to:
Porto - Lisbon - Porto Train Timetable
If you are travelling in high summer you should book in advance if possible but the Portuguese railway online booking system is not that great.
You can try it here at www.cp.pt.
The price at present for the service in question will be Euro 27.50 but this may go up soon.