The Messenger of Allah ﷺ came to his mother's grave and wept, and those around him wept as well. Then the Messenger of Allah ﷺ said, "I sought permission from my Lord, the Exalted, to ask forgiveness for her, but I was not granted it. Then I sought permission to visit her grave, and I was granted it. So visit the graves, for they remind you of death."
حدثنا محمد بن سليمان الأنباري حدثنا محمد بن عبيد عن يزيد بن كيسان عن أبي حازم
أتى رسول الله ﷺ قبر أمه فبكى وأبكى من حوله فقال رسول الله ﷺ استأذنت ربي تعالى على أن أستغفر لها فلم يؤذن لي فاستأذنت أن أزور قبرها فأذن لي فزوروا القبور فإنها تذكر بالموت
Related by Muslim, Chapter on Funerals, section on the Prophet's ﷺ seeking permission from his Lord, Mighty and Sublime, to visit his mother's grave, hadith no. 976, from the hadith of Muhammad bin Ubayd, with this wording.