Apostasy is the act of leaving a religion for another religion or for non-belief. Many religions have rules against apostasy and lay out specific punishments for apostates. For instance, most Islamic scholars agree that the death penalty is the appropriate punishment for a male apostate, and that either imprisonment or death is appropriate for a female apostate. Other religions, such as Scientology and the Jehovah's Witnesses, urge their followers to shun apostates. These types of punishments are meant to keep believers faithful through fear.
The penalty of apostasy in the Catholic Church is automatic excommunication.  Excommunication is said to be Latae sententiae because the sentence is automatically imposed, if the apostasy is a wilful act carried out by an informed person.  An excommunicated person is forbidden to receive the sacraments (communion, weddings, etc) but is still allowed to attend church events. 
Between 2006 and 2009, act of actus formalis defectionis ab Ecclesia catholica was a way to inform the church of defection. It is unclear if this is required for an apostasy to be considered "formal", rather than "material". This act required notification of a competent ecclesiastical authority.  After 2009, changes to canon law abolished this procedure and inquiries to find an replacement have not been answered. 
The traditional penalty for apostasy in Islam is death, although this is only upheld in a few countries. Saudi Arabia is suspected of carrying out executions for apostasy although details are hard to verify in their secretive death penalty system.  Several other countries have the crime on their penal code although it is not always applied, including Iran . The penalty is based on the Qur'an 4:89 :
- "They but wish that ye should reject Faith, as they do, and thus be on the same footing (as they): But take not friends from their ranks until they flee in the way of Allah (From what is forbidden). But if they turn renegades, seize them and slay them wherever ye find them; and (in any case) take no friends or helpers from their ranks;-"
Although the penalty is not upheld in most countries, there is significant support for the policy. Death for apostasy was supported by 36% of young (16-24 years old) UK Muslims. 
- ↑ Code of Canon Law, Book 4, Part 2, Title 1, 1364 
- ↑ 2.0 2.1 Colin B. Donovan, "Heresy, Schism and Apostasy" 
- ↑ Actus Formalis Defectionis Ab Ecclesia Catholica, 13 March 2006
- ↑ Church Continues to Block Formal Cessation of Membership, 20/07/2011 
- ↑ Ian Black, Amnesty condemns 'horror' of Saudi executions, The Guardian, 14 October 2008 
- ↑ Saeed Kamali Dehghan, Iranian Christian pastor released from jail, The Guardian, 8 September 2012 
- ↑ Policy exchange, Living apart together British Muslims and the paradox of multiculturalism, 29 January 2007