2:234
وَٱلَّذِينَ يُتَوَفَّوْنَ مِنكُمْ وَيَذَرُونَ أَزْوَٰجًۭا يَتَرَبَّصْنَ بِأَنفُسِهِنَّ أَرْبَعَةَ أَشْهُرٍۢ وَعَشْرًۭا ۖ فَإِذَا بَلَغْنَ أَجَلَهُنَّ فَلَا جُنَاحَ عَلَيْكُمْ فِيمَا فَعَلْنَ فِىٓ أَنفُسِهِنَّ بِٱلْمَعْرُوفِ ۗ وَٱللَّهُ بِمَا تَعْمَلُونَ خَبِيرٌۭ
And those who are taken in death among you and leave wives behind - they, [the wives, shall] wait four months and ten [days]. And when they have fulfilled their term, then there is no blame upon you for what they do with themselves in an acceptable manner. And Allah is [fully] Acquainted with what you do.
Translation · Saheeh International
Tafsir
Ibn Kathīr (abridged)
The `Iddah (Waiting Period) of the Widow
This Ayah contains a command from Allah to the wives whose husbands die, that they should observe a period of `Iddah of four months and ten nights, including the cases where the marriage was consummated or otherwise, according to the consensus (of the scholars).
The proof that this ruling includes the case where the marriage was not consummated is included in the general meaning of the Ayah. In a narration recorded by Imam Ahmad and the compilers of the Sunan, which At-Tirmidhi graded Sahih, Ibn Mas`ud was asked about a man who married a woman, but he died before consummating the marriage. He also did not appoint a Mahr (dowry) for her. They kept asking Ibn Mas`ud about this subject until he said, "I shall give you my own opinion, and if it is correct then it is from Allah, while if it is wrong it is because of my error and because of (the evil efforts of) Satan. In this case, Allah and His Messenger are innocent of my opinion. She has her full Mahr." In another narration, Ibn Mas`ud said, "She has a similar Mahr to that of the women of her status, without stinginess or extravagance." He then continued, "She has to spend the `Iddah and has a right to the inheritance." Ma`qil bin Yasar Ashja`i then stood up and said, "I heard Allah's Messenger ﷺ issue a similar judgment for the benefit of Barwa` bint Washiq." `Abdullah bin Mas`ud became very delighted upon hearing this statement. In another narration, several men from Ashja` (tribe) stood up and said, "We testify that Allah's Messenger ﷺ issued a similar ruling for the benefit of Barwa` bint Washiq."
As for the case of the widow whose husband dies while she is pregnant, her term of `Iddah ends when she gives birth, even if it occurs an instant (after her husband dies). This ruling is taken from Allah's statement:
وَأُوْلَـتُ الاٌّحْمَالِ أَجَلُهُنَّ أَن يَضَعْنَ حَمْلَهُنَّ
(And for those who are pregnant, their `Iddah is until they lay down their burden.) (65:4)