Can You Quote Al-Qadar as an Excuse for Committing Sins?
Question

Is it correct for a sinner to justify his falling into sin by saying that this is what Allah has decreed for him?
Praise be to Allah.Belief in Al-Qadar is no excuse for failing to do obligatory duties 
Some sinners and some who fall short (in religious commitment) make excuses for their shortcomings and sins by saying that Allah is the One Who has decreed this for them, so they should not be blamed for it. 
What they say is not correct under any circumstances. There can be no doubt that belief in Al-Qadar is no excuse for failing to do obligatory duties or committing sins, according to the consensus of the Muslims and all those who are wise. 
Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
“No one has the right to make excuses for sin by referring to Al-Qadar , according to the consensus of the Muslims and the followers of other religions, and all those who are wise. If this were acceptable, then anyone could do whatever crosses his mind of murder, seizing people’s wealth and any kind of spreading mischief in the land, and quote Al-Qadar as his excuse. If a person who quotes Al-Qadar as an excuse were attacked by another person who also quoted Al-Qadar as an excuse for that, he would not accept that, and thus he would contradict himself, which in itself is proof that this logic is false. So using Al-Qadar as an excuse is clearly flawed, as is obvious to anyone who has any common sense.” (Majmu` Al-Fatawa, 8/179) 
Shari`ah and common sense indicate that it is invalid to give Al-Qadar as an excuse for committing sin
Both the texts of Shari`ah and common sense indicate that it is invalid to give Al-Qadar as an excuse for committing sin or not doing obligatory actions. 
The evidence of Shari`ah includes the following: 

The verse in which Allah says (interpretation of the meaning): 

“Those who took partners (in worship) with Allah will say: ‘If Allah had willed, we would not have taken partners (in worship) with Him, nor would our fathers, and we would not have forbidden anything (against His Will).’ Likewise belied those who were before them, (they argued falsely with Allah’s Messengers), till they tasted Our Wrath. Say: ‘Have you any knowledge (proof) that you can produce before us? Verily, you follow nothing but guess and you do nothing but lie’.”  [Al-An`am 6:148] 
These polytheists quoted Al-Qadar as an excuse for their Shirk, but if their excuse had been valid Allah would not have caused them to taste His Wrath. Whoever gives Al-Qadar as an excuse for sin and shameful behaviour might as well justify the ways of the disbelievers and attribute injustice to Allah as well – Exalted be Allah far above that. 

Allah says (interpretation of the meaning): 

“Messengers as bearers of good news as well as of warning in order that mankind should have no plea against Allah after the (coming of) Messengers. And Allah is Ever All-Powerful, All-Wise.” [An-Nisa’ 4:165] 
If Al-Qadar were an acceptable excuse for committing sin, definitive proof would not have been established by the sending of the Messengers, and indeed there would have been no point in sending the Messengers. 

Allah issues commands and prohibitions to His slaves, but He does not burden them with more than they can bear: 

“So keep your duty to Allah and fear Him as much as you can.” [At-Taghabun 64:16] 
“Allah burdens not a person beyond his scope.” [Al-Baqarah 2:286] 
If a person were forced to do things, he would be obliged to do things over which he had no control and this is not right. Hence whatever wrongs he commits due to ignorance or being compelled to do them, there is no sin on him for that, because he has an excuse. If this excuse (of Al-Qadar) were valid, then there would be no difference between one who is forced to do something, one who is ignorant and one who does it deliberately. But what is in fact known from real life and basic common sense, is that there is a great difference between them. 

Al-Qadar is something secret and concealed which no one in creation knows until it has come to pass. When a person does something, his will precedes his action, so his will to do it is not based on knowledge of the decree of Allah. So his claim that Allah has decreed that he should do such and such is a false claim, because it is a claim to have knowledge of the unseen, but no one knows the unseen except Allah. So this argument is flawed, because no man can base his evidence on something of which he knows nothing. 
Quoting Al-Qadar as an excuse for sin implies that the laws of Allah are pointless and that the reckoning, resurrection, and reward and punishment will not happen. 
If Al-Qadar were a valid excuse for sin, the people of Hell would have used it, when they see the punishment and realise that they are going to fall into it and when the angels start to rebuke them. But in fact they do not use it as an excuse, rather they say – as Allah tells us (interpretation of the meaning) –  

“ ‘Our Lord! Respite us for a little while, we will answer Your Call and follow the Messengers!’” [Ibrahim 14:44] 
“‘Our Lord! Our wretchedness overcame us.’” [Al-Mu’minun 23:106] 
“‘Had we but listened or used our intelligence, we would not have been among the dwellers of the blazing Fire!’” [Al-Mulk 67:10] 
“We were not of those who used to offer the prayers.” [Al-Muddaththir 74:43], etc. 
If Al-Qadar were a justifiable excuse for sin, they would use it, for they are in the most desperate need of an excuse that would save them from the Fire of Hell. 

If Al-Qadar were a valid excuse for sin, it would have been an excuse for satan who said: 

“ ‘Because You have sent me astray, surely, I will sit in wait against them (human beings) on Your straight path’” [Al-A`raf 7:16 – interpretation of the meaning] 
And Pharaoh the enemy of Allah would have been equal with [Prophet] Musa (peace be upon him), the one with whom Allah spoke. 

Another point that refutes this argument and demonstrates it to be invalid, is the fact that we see how people are keen to get what benefits them in this world. You never see anyone who ignores worldly things that are good for him and doing things that harm him on the grounds that this is what Allah has decreed. Why would anyone turn away from that which will benefit him in spiritual terms and turn to that which will harm him, and then claim that this is what Allah has decreed for him? 

I will give some examples which will clarify that for you: if a person wants to travel to some country, and there are two routes to this country, one of which is safe and secure, and the other is remote and dangerous, with the risk of murder and robbery, which route will he take? 
Undoubtedly he will take the first route. So why, with regard to the Hereafter, does he not take the road to Paradise and avoid the road to Hell? 

Another point that may be used to refute the one who quotes Al-Qadar as evidence, is to follow his own line of reasoning and tell him: “Do not get married, and if Allah has decreed that you should have a son, you will have one, otherwise you will never have a child. Do not eat or drink, and if Allah has decreed that you should be satisfied, that will happen, otherwise it will never happen. If a wild animal attacks you, do not run away from it, and if Allah has decreed that you should be saved, then you will be, and if He has not decreed that you will be saved, running away will not help you. If you fall sick, do not seek treatment, and if Allah has decreed that you will recover then you will do so, but if He has not then medicine will never help you.” 

Will he agree with such comments or not? If he agrees with us, then we will know that his reasoning is not sound. If he disagrees with us, we will know that what he says and the excuses he gives are not valid. 

The one who quotes Al-Qadar as an excuse for sin is likening himself to the insane and minors, who are not accountable and will not be taken to task, but if he were to be treated as they are in this world he would not accept that. 
If we accept this excuse, there would be no need to pray for forgiveness, or repent, or make Du`aa’, or strive in Jihad, or enjoin what is good and forbid what is evil. 
If Al-Qadar were an excuse for shameful behaviour and sin, then there would be anarchy and chaos. There would be no need for hudud and Ta`zir punishments, or other types of penalties, because the wrongdoer would be able to quote Al-Qadar as an excuse and we would not need to punish wrongdoers and bandits or to have courts and a judiciary system, because everything that happens only by the decree of Allah. But no wise man would say such a thing. 
The one who gives Al-Qadar as an excuse says: We will not be taken to task, because Allah has decreed this for us, and how can we be taken to task for something that has been decreed for us? 

We say to him: We will not be taken to task for that which has already been decreed for us, but we will be taken to task for what we do and earn. We are not commanded to do that which Allah has decreed for us, rather we are commanded to do that which is enjoined upon us. There is a difference between what Allah wills for us and what He wants from us. What He wills for us He has kept secret, but what He wants from us He has commanded us to do. 
The fact that Allah knows what we will do from eternity and has written that down is not an excuse, because His all-encompassing knowledge means that He knows what His creation will do, but that does not imply any kind of compulsion. By way of example – and for Allah is the highest description (cf Al-Nahl 16:60) – if a teacher knows that one of his students will not make the grade this year because he is too careless and lazy, then this student fails just as the teacher knew he would, would any wise person say that the teacher forced him to fail, or would the student have any right to say “I did not succeed because this teacher knew that I would never succeed”?! 
In conclusion, quoting Al-Qadar as an excuse for committing sin or for not doing obligatory duties is a false excuse, according to Shari`ah, common  sense and reality. 
It is worth pointing out that many of those who use this excuse do not do so out of conviction and faith, rather they base their argument on whims and desires and stubbornness. Hence one of the scholars said to one such person: “When it comes to obedience you are a Qadari and when it comes to sin you are a Jabari; whatever school of thought suits your whims and desires, you follow it.” (Majmu` Al-Fatawa, 8/107).  In other words, when he did an act of worship or obedience he attributed it to himself and denied that Allah had decreed that, but when he committed a sin he quoted Al-Qadar as an excuse. 
Shaykh Al-Islam Ibn Taymiyah (may Allah have mercy on him) said of those who quote Al-Qadar as an excuse: 
“If these people persist in this belief they will be worse disbelievers than the Jews and Christians. (Majmu` Al-Fatawa, 8/262) 
Based on this, there is no justification for a person to quote Al-Qadar as an excuse for his faults and sins. 
Al-Qadar may be invoked when calamities befall a person
Al-Qadar may be invoked when calamities befall a person such as poverty and sickness, loss of a loved one, destruction of crops, loss of wealth, accidental killing, and so on. This is a sign of full acceptance of Allah as one’s Lord. In this case referring to Al-Qadar is only valid when it has to do with calamities, not faults. The fortunate one is the one who seeks forgiveness for faults and is patient in the face of calamity, as Allah says (interpretation of the meaning): 
“So be patient (O Muhammad). Verily, the Promise of Allah is true, and ask forgiveness for your fault.” [Ghafir 40:55] 
The doomed one is the one who panics at the time of calamity and quotes Al-Qadar as an excuse for sin. 
The following example will help to explain this further: if a man is speeding in his car and fails to drive safely and causes an accident, then he is blamed for that and called to account, and he gives Al-Qadar as an excuse, that excuse will not be accepted from him, whereas if a person’s car is struck whilst stationary, and another person blames him and he responds by referring to Al-Qadar , this will be acceptable, unless he was parked in the wrong place. 
The point is that whatever a person does and whatever choices he makes cannot be excused by referring to Al-Qadar, but whatever is beyond his will and control may correctly be attributed to Al-Qadar. 
Hence Adam and Musa (peace be upon them) disputed, as is described in the Hadith of the Prophet (peace and blessings of Allah be upon him) who said: “Adam and Musa disputed. Musa said to him: ‘You are Adam whose sin caused you to be expelled from Paradise.’ Adam said to him: ‘You are Musa whom Allah chose to convey His message and to speak to; are you blaming me for something that Allah decreed for me before I was created?’ So Adam won the argument with Moses.” (Narrated by Muslim, 2652) 
Adam (peace be upon him) did not quote Al-Qadar as an excuse for his sin as may be imagined by those who do not think about the meaning of the Hadith, and Musa (peace be upon him) did not blame Adam for his sin, because he knew that Adam had asked his Lord for forgiveness and repented, and his Lord had accepted his repentance and guided him, and the one who repents from sin like one who did not sin. 
If Musa had blamed Adam for his sin, he would have replied: “I sinned but then I repented, and Allah accepted my repentance,” or he would have said: “You, O Musa, also killed a soul, and you threw down the Tablets,” and so on. Rather Musa referred to the calamity and Adam responded by referring to Al-Qadar. (See Al-Ihtijaj bi’l-Qadar by Shaykh Al-Islam Ibn Taymiyah, 18-22) 
Whatever calamities are divinely decreed, we must accept them, for that is part of full acceptance of Allah as one’s Lord. With regard to sins, no one has the right to sin; if he does commit sin then he has to seek forgiveness and repent, so he should repent from sin and be patient in the face of calamity.” (Sharh At-Tahhawiyyah , 147) 
Can the one who repents from sin refer to Al-Qadar as an excuse?
Some of the scholars said that one of those who are justified in referring to Al-Qadar as an excuse is the one who repents from sin, so if anyone blames him for a sin from which he has repented, he may refer to Al-Qadar in this case. 
If it is said to one who has repented: “Why did you do such and such?” and he responds by saying, “That happened by the will and decree of Allah, but I have repented and asked forgiveness,” this excuse is acceptable in his case, because in his case the sin is like a calamity that befell him, and he did not quote Al-Qadar as an excuse for his negligence, rather he is referring to the calamity that befell him, which is disobedience towards Allah. Undoubtedly sin is a kind of calamity, and he is referring to Al-Qadar after the sin took place, and he is admitting his sin. So no one has the right to condemn the one who has repented from sin. What matters is how a person ends up, not the shortcomings that he may commit in the beginning. 
And Allah knows best. 
References: 

A`lam As-Sunnah Al-Manshurah, 147;
Al-Qada wal-Qadar fi Daw’ il-Kitab was-Sunnah by Shaykh Dr. `Abd Ar-Rahman Al-Mahmud;
Al-Iman bil-Qada’ wal-Qadar by Shaykh Muhammad Al-Hamd; 
And the summary by Al-Shaykh Sulayman Al-Khurashi of the belief of Ahl Al-Sunnah in Al-Qadar as discussed in his book Turki Al-Hamd fi Mizan Ahl As-Sunnah.