كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(24)
Chapter: It is recommended to seek refuge with Allah from the punishment of the grave, the punishment of hell, the trials of life and death, the tribulation of the Dajjal and from sin and debt between the tashah-hud and the taslim
(24)
باب اسْتِحْبَابِ التَّعَوُّذِ مِنْ عَذَابِ الْقَبْرِ ‏
Sahih Muslim 584

'A'isha reported:

The Prophet (ﷺ) entered my house when a Jewess was with me and she was saying: Do you know that you would be put to trial in the grave? The Messenger of Allah (ﷺ) trembled (on hearing this) and said: It is the Jews only who would-be put to trial. 'A'isha said: We passed some nights and then the Messenger of Allah (ﷺ) said: Do you know that it has been revealed to me:" You would be put to trial in the grave"? 'A'isha said: 1 heard the Messenger of Allah (ﷺ) seeking refuge from the torment of the grave after this.
حَدَّثَنَا هَارُونُ بْنُ سَعِيدٍ، وَحَرْمَلَةُ بْنُ يَحْيَى، قَالَ هَارُونُ حَدَّثَنَا وَقَالَ، حَرْمَلَةُ أَخْبَرَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ بْنُ يَزِيدَ، عَنِ ابْنِ شِهَابٍ، قَالَ حَدَّثَنِي عُرْوَةُ بْنُ الزُّبَيْرِ، أَنَّ عَائِشَةَ، قَالَتْ دَخَلَ عَلَىَّ رَسُولُ اللَّهِ صلى الله عليه وسلم وَعِنْدِي امْرَأَةٌ مِنَ الْيَهُودِ وَهْىَ تَقُولُ هَلْ شَعَرْتِ أَنَّكُمْ تُفْتَنُونَ فِي الْقُبُورِ قَالَتْ فَارْتَاعَ رَسُولُ اللَّهِ صلى الله عليه وسلم وَقَالَ ‏"‏ إِنَّمَا تُفْتَنُ يَهُودُ ‏"‏ ‏.‏ قَالَتْ عَائِشَةُ فَلَبِثْنَا لَيَالِيَ ثُمَّ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ هَلْ شَعَرْتِ أَنَّهُ أُوحِيَ إِلَىَّ أَنَّكُمْ تُفْتَنُونَ فِي الْقُبُورِ ‏"‏ ‏.‏ قَالَتْ عَائِشَةُ فَسَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم بَعْدُ يَسْتَعِيذُ مِنْ عَذَابِ الْقَبْرِ ‏.‏
Reference : Sahih Muslim 584
In-book reference : Book 5, Hadith 157
USC-MSA web (English) reference : Book 4, Hadith 1212
  (deprecated numbering scheme)