Firstly, the Algarve is a region and not a single place. Consequently, I cannot answer this question specifically without knowing your exact destination.
However, there are three main means of public transport linking Algarve towns with Lisbon. Rail and two long distance bus services.
If you visit my blog:
http://barlaventostravelblog.blogspot.com/
»» Scroll down on the right hand side until you come to the panel entitled "Algarve & Portugal - Travel Transport Links"
»» Click on:
- Porto - Lisbon - Faro Train Timetable for the return train timetable.
- Algarve Regional Line Train Timetable for connections along the Algarve.
- RENEX Bus Service - Lisbon to Algarve timetable
- Rede-Expressos - National Bus Timetable - Updated. (National Coach Operator) - Portuguese only.
There are no direct train services between Malaga and the Algarve.
www.alsa.es operate a direct service between Malaga and Faro daily as follows:
Dept. MALAGA 21:00
Arr. Faro 01:45
I strongly recommend booking a hostel or pension near Faro bus Station if you arrive on this bus as downtown Faro is no a good place to be at that time.
There are other daily buses that run between Seville and the Algarve operated by DAMAS/EVA.
Checkout Cubsur's site here for more info:
http://thomasallen.home.sapo.pt/travel/001.htm