Will a person be forgiven if the person plans to ask for forgiveness later? For example: A person plans to commit a sin while he is fully aware of what is he is about to do and plans to ask for forgiveness from Allah later. Will Allah, The most merciful, forgive him? Let's assume that he asks for forgiveness with his whole heart.
Those who commit sins are termed in Qura'an (Q; 4:17) as "Jahil" ignorant or stupid; which does not mean that they do not know what they are doing but are rather under the spell of satan causing intense emotions; obscuring/impairing their sense of judgment, while they knowingly committing sins. It can simply be equated with the claim of "insanity" as a defense in western common Law for one who has committed a crime in the fit of rage.
Second, part of the question relates to the time of repentance. In this verse, this issue also has been addressed. Though It ushers immediate returning to Allah for repentance. But the interpretation of immediate; owing to the limitless mercy of Allah, extends till the last moment when the pangs or throes of death approach.
There are two stages before death. One is when one knows for sure that it is time to go as nothing can be done. It is the time of "conscious-suffering" then there is a time when the soul starts departing and sounds start coming out of the throat. it is the situation of "absolute despair"
Forgiveness may be sought till the first stage but not at or after the second stage. It is generally agreed upon by the majority of scholars. Allah, nevertheless, Has the authority and right to forgive anyone at any time as He is not bound by linear time or temporality. Thanks Shakir2.wordpress.com