There is a common belief that one who passes away during blessed days or months is saved from the punishment of the grave.
The following discussion supports this.
Death on a Friday
Sayyiduna ‘Abdullah ibn ‘Amr ibn al-‘As (radiyallahu ánhuma) reports that Rasulullah (sallallahu álaihi Wasallam) said, ‘Whoever passes away on a Friday will be saved from the punishment of the grave.’
(Musnad Ahmad vol.2 pg.220; Hadith 7050, 6646).
Similar narrations have been reported by Sayyiduna Jabir ibn Abdullah
(refer Hilyat al-Awliya vol.3 pg.181),
Sayyiduna Anas ibn Malik (refer Abu Ya’ala, Majma al-Zawa’id vol.2 pg.319)
and others. see: Al-Maqasidul Hasanah, Hadith:1186
Meaning of this Hadith
It is possible that the punishment is withheld for that day or even permanently. (Fatawa Mahmudiyya vol.6 pg.62; Rad al-Muhtar vol.2 pg.165)
Death in Ramadhan
As for the one passing away in Ramadan being saved from punishments, this can be deduced from the hadith that in Ramadan, the doors of Jahannam (Hell) are closed and the doors of Jannah are opened. (Sahih al-Bukhari hadith 3277; also refer to Fatawa Mahmudiyya vol.6 pg.63)
Hafiz Ibn Rajab al-Hambali (rahimahullah) states, ‘Our predecessors preferred a death after the performance of a good action like the fast of Ramadan … and it used to be said, ‘Whoever passes away in this manner is forgiven’.’(Lata’if al-Ma’arif pg.173)
Imam Ibn Abid-Dunya (rahimahullah) has narrated from Imams; Musayyab ibn Rafi’i (rahimahullah) and Khaythamah ibn ‘Abdul-Rahman (rahimahullah) (two tabi’een) that they said, ‘It used to be said (i.e, by the Sahabah ), ‘Whoever observes the fast of Ramadan and passes away during that year enters Jannah.’ (Fadha’il Shahr Ramadan pgs.44;48)
Temporary reprieve in Ramadan
Hafiz Ibn Rajab (rahimahullah) has quoted a narration that is reported with a weak chain from Sayyiduna Anas (radiyallahu’anhu) that he said:
‘Indeed the punishment of the grave is uplifted/halted from the inmates of the graves in Ramadan’
(Ahwalul Qubur, pg.105-106)
And Allah Ta’ala Knows Best,