If you have TPS, you can travel abroad but only if you have permission from United States Citizenship and Immigration Services (USCIS). Specifically, you must seek permission by filing Form I-131, Application for Travel Document with the agency.
If USCIS grants your request, you will get an official paper called an Advance Parole travel document. This is what allows you to leave and return to the United States at least once within a specified time. However, you will only be allowed to stay outside of the United States for no more than 90 days.
Getting an Advance Parole document and following the rules pertaining to applicable travel dates are not optional. If you travel without permission or fail to return to the United States by a specified date, you will jeopardize your Temporary Protected Status (Form I-821).