Ayah

وَلَا تُصَلِّ عَلَىٰٓ أَحَدٍ مِّنۡهُم مَّاتَ أَبَدًا وَلَا تَقُمۡ عَلَىٰ قَبۡرِهِۦٓ ۖ إِنَّهُمۡ كَفَرُواْ بِٱللَّهِ وَرَسُولِهِۦ وَمَاتُواْ وَهُمۡ فَٰسِقُونَ
Translation

Nor do thou ever pray for any of them that dies, nor stand at his grave; for they rejected Allah and His Messenger, and died in a state of perverse rebellion.<br/>
Tafsir

When the Prophet may peace and salutation be upon him prayed over [the dead body of 'Abd Allaah] Ibn Ubayy, the following was revealed: And never pray over any one of them when he is dead, nor stand over his grave, at a burial or as a visit; lo! They disbelieved in God and His Messenger, and died while they were wicked, [they died] disbelieving.