There is a departure of a RENEX bus from the Gare Oriente Bus Station to Quarteira at 01:00.
Gare Oriente Bus Station is about 10 minutes by taxi from the Airport. With bags and being late at night you should expect to pay up to € 10.00 for the taxi.
Arriving at 11:55 p.m. (i.e. nearly midnight) will be a problem.
However, if your plane is delayed, or there are delays in unloading your bags, it is unlikely you will be able to make the bus at 01:00. The bus arrives in Quarteira at 04:40.
The next RENEX bus is at 05:30. It arrives in Quarteira at 09:35 You would be best to wait at Lisbon Airport, as the area around Gare Oriente Bus Station is not that secure at night.
Please note that August is 6 months away and the timetables may change before that. You should check timetables again nearer the time.