Assalamualaikum ustaz. Is it considered sinful if a person cheated in exams? Hope for an explanation.
Waalaikumussalam wrt. wbt.,
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
We’ll start with the statement of Allah SWT:
يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تَخُونُوا اللَّهَ وَالرَّسُولَ وَتَخُونُوا أَمَانَاتِكُمْ وَأَنتُمْ تَعْلَمُونَ
“O you who have believed, do not betray Allah and the Messenger or betray your trusts while you know [the consequence].” 
Al-Maraghi explained the prohibition against betrayal on the trust of Allah by neglecting Allah’s commandments, violating His prohibitions and transgressing the limitations of religion. Likewise, the prohibition against betrayal towards Rasullullah PBUH by not following his explanation but taking and holding unto the explanation of his nafs (desires), the opinion of his teacher, father or order of his ruler. Not only that, but betrayal towards Rasullullah PBUH is also in the form of not following his sunnah, consequently, following the sunnah of his father or ruler who claims they know better what is meant and wanted by Allah SWT and His Messenger.
Next, it is also explained that the prohibition against betraying the trust between people in the types of affairs which involve the matters of muamalat, character and social aspects. The same for the prohibition against betrayal towards the ruler in terms of politics and war, for the act, can benefit the enemies. Thus, in the context of the prohibition against betrayal among people, betrayal towards the trust in learning and working is also prohibited by Allah SWT. 
Cheating in examination
Generally, the act of cheating in exams is included as an act of lying and deception which is prohibited and its doer is considered sinful. This is based on a hadith from Abu Hurairah RA, where the Prophet PBUH went through a place of food (that is going to be sold). Suddenly, in the piles of food, inside it, he can feel some dampness – spoiled. The Prophet PBUH asked: “What is this, O owner of the grain?” He replied, “Rain had fallen on it, O Allah’s Messenger.” He said,
أَفَلَا جَعَلْتَهُ فَوْقَ الطَّعَامِ كَيْ يَرَاهُ النَّاسُ، مَنْ غَشَّ فَلَيْسَ مِنِّي
“Why did you not put it (the damp part) on the top of the foodstuff so that people might see it? Whoever cheats has nothing to do with me.” 
In a narration from Muslim, the hadith comes with the wording:
وَمَنْ غَشَّنَا فَلَيْسَ مِنَّا
“And he who treats us dishonestly does not belong to us.” 
Syams al-Haq al-‘Azim Abadi cited from al-Khattabi, said that the above hadith means not on our road and madhhab (the guidance of the Prophet PBUH). In other words, whoever lies to his brother and doesn’t advise him, then indeed, he has left the guidance of the Prophet PBUH and doesn’t hold unto the sunnah of the Prophet PBUH. However, there are some scholars who are of the opinion that it denies the person from Islam. However, this interpretation is untrue because the meaning meant from the hadith is to follow the guidance and sunnah of the Prophet PBUH. This is strengthened through the statement of Allah SWT:
فَمَن تَبِعَنِي فَإِنَّهُ مِنِّي ۖ وَمَنْ عَصَانِي فَإِنَّكَ غَفُورٌ رَّحِيمٌ
“So, whoever follows me – then he is of me; and whoever disobeys me – indeed, You are [yet] Forgiving and Merciful.” 
Thus, this hadith is evidence that shows the prohibition against lying and this matter is agreed upon. . Hence, it is clear to us that the act of deception is not from the teachings of Islam. A person can claim and consider the act of cheating as a small matter and shouldn’t be magnified. In truth, the act of cheating is among the main reasons that cause various issues and problems in society such as the rampant issue of corruption, forged certificates and others, which ultimately lead to unqualified people holding important posts in society and this lead to destruction.
Furthermore, with the assumption that the practice of cheating is a small matter, it is feared that it will soon be considered as a norm and there is no more guilt in committing it. This is as stated in a narration from Abdullah RA, from the Prophet PBUH, he said:
إِنَّ الصِّدْقَ يَهْدِي إِلَى البِرِّ، وَإِنَّ البِرَّ يَهْدِي إِلَى الجَنَّةِ، وَإِنَّ الرَّجُلَ لَيَصْدُقُ حَتَّى يَكُونَ صِدِّيقًا. وَإِنَّ الكَذِبَ يَهْدِي إِلَى الفُجُورِ، وَإِنَّ الفُجُورَ يَهْدِي إِلَى النَّارِ، وَإِنَّ الرَّجُلَ لَيَكْذِبُ حَتَّى يُكْتَبَ عِنْدَ اللَّهِ كَذَّابًا
“Truthfulness leads to righteousness, and righteousness leads to Paradise. And a man keeps on telling the truth until he becomes a truthful person. Falsehood leads to Al-Fajur (i.e. wickedness, evil-doing), and Al-Fajur (wickedness) leads to the (Hell) Fire, and a man may keep on telling lies till he is written before Allah, a liar.” 
Al-Nawawi stated that the above hadith contains the encouragement for every individual to always be truthful and the prohibition against lying or thinking of the matter lightly. The reason is if one takes it lightly too many times, slowly it will become a norm for him – that he deserves to be written as a liar. 
According to the above discussion, cheating in exams is included as an act of lying which is prohibited in religion and is sinful. Especially when the act of cheating affects himself, society and the country,
Taking this opportunity, we’d also like to advise us all to reflect on what has happened and repent to Allah SWT with a true repentance as well as increasing our dhikr and istighfar to him.
May Allah SWT grant us all a clear understanding in religion. Amin.
 Surah al-Anfal: 27
 See Tafsir al-Maraghi, 9/191-194.
 Narrated by Muslim (102); Narrated by Ibn Hibban (4905) and Syu‘aib al-Arna’ut stated the sanad of this hadith is sahih according to the conditions of Muslim.
 Narrated by Muslim (101)
 Surah Ibrahim: 36
 See ‘Aun al-Ma‘bud, 9/231;
 Narrated by al-Bukhari (6094)
 See al-Minhaj Syarh Sahih Muslim, 16/160.