Within the Islamic world there are at least 14 states that make it illegal to convert out of Islam. In at least eight of those states, it is punishable by death.
Several verses in the Koran severely condemn apostasy but fall short of calling for the death penalty.
But in the Hadith, Islam's other holy book, Mohammed said those who leave Islam should be killed. Mohammed's direct successors--the Caliphs--also said apostates should receive death.