Under current United States federal law, all former presidents are entitled to lifetime protection from the Secret Service. Barring an act of Congress or a presidential executive order, the Secret Service is bound by law to protect former presidents for life. There aren't any exceptions listed in the statute governing the protection of former presidents.
The only legal reason currently for abandoning protection would be if a former president waived his right to his Secret Service detail, which only one former president has ever done. Richard Nixon waived his Secret Service protection 11 years after leaving office in disgrace following the Watergate scandal. (Nixon decided to pay for his own protection to save the U.S. government some money.)
But now, former president Donald Trump has been indicted on multiple felony charges related to misstating the purpose of a payment to the adult film star Stormy Daniels. (This can be considered a felony if it is done to hide another crime.) With that indictment, Trump became the first U.S. president, sitting or former, to face criminal prosecution. Few legal experts expect Trump to receive a prison sentence if convicted, but it remains a possibility.
Trump could face more serious charges, however, if he's indicted by grand juries investigating him in separate criminal probes in Fulton County in Atlanta related to his efforts to overturn the 2020 election in Georgia and the Department of Justice in Washington, D.C. related to the classified documents at found at Mar-a-Lago, Trump's home. Those charges, which could include obstruction of justice, typically include prison time if convicted.