Yes, it is true that leaving Islam, in an Islamic state, can be a reason for someone to be put to death. Note the caveat: in an Islamic state. We do not have any Islamic state today; only Muslim countries who mix some parts of Islamic law with other types of law.
But an answer I received to my similar question (Is the belief that people who want to leave Islam should be put to death a widely held interpretation?) stated this:
peace be upon you, It can be proven by the following hadith, Prophet Muhammad (S.A.W) has said: The blood of a Muslim person who bears witness that there is no God but Allah and that I am Allah's Messenger, is not lawful (to shed) except for one of three reasons, (i) a married man commits fornication, (ii) life for a life, and (iii) who abandons his religion and separates from his community. (Sunan Abu-Dawood)
I can't verify the accuracy of this answer, but since the first answer I quoted states that such rules are only applicable in an Islamic state, this is confusing. Is the quote that lists Prophet Muhammad's exceptions to bloodshed accurate? If so, then it seems that the Prophet Muhammad tells people of Islam that bloodshed is acceptable if a man has left Islam. Why would this teaching of Prophet Muhammad only matter if the man is in an Islamic state?