Whoever disbelieves in [i.e., denies] Allāh after his belief...1 except for one who is forced [to renounce his religion] while his heart is secure in faith. But those who [willingly] open their breasts to disbelief, upon them is wrath from Allāh, and for them is a great punishment;
Translation: Saheeh International (English)
1 Based upon the conclusion of this verse, the omitted phrase concerning the apostate is understood to be "...has earned the wrath of Allāh..."
Whoever denies Allah after having faith in Him is in one of two situations: His denial is by means of a statement or action that he was coerced to make or do, whilst his heart is firm on his faith. This person is a believer. The second situation is when the person is content with and comfortable with such denial. Such a person and others like him are apostates from Islam, the anger of Allah is on them and in the afterlife they will receive a great punishment.