It will be a very long day.
You can either drive, train or bus it!
Driving would be quickest (3hrs30mins) but with the price of tolls and fuel, I don't really recommend it.
From Albufeira Centre or Bus Station one can take a Renex bus to Lisbon Oriente Bus Station and then Metro to Cais de Sodre Station and then train to Cascais.
From Albufeira Centre or Bus Station one can take a Rede Expressos/EVA bus to Lisbon Sete Rios Bus Station and then Metro to Cais de Sodre Station and then train to Cascais.
From Albufeira Train Station (located 8kms from Albufeira - buses from Albufeira) one can take a Train to Lisbon Entrecampos Station and then Metro to Cais de Sodre Station and then train to Cascais.
The fastest public transport combination would probably require 4hrs30mins minimum each way.
For more info see Cubsur's excellent site: www.algarve-bus.info