The evidence for this is that the Prophet ﷺ offered the funeral prayer at a grave up to one month later. (1)
However, the fact that the Messenger ﷺ prayed at a grave after a month had passed does not establish a fixed limit, because this was an occurrence that happened coincidentally and was not intended. What occurs coincidentally is not, in itself, evidence, since it was not intended.
The disagreement among the scholars of the madhhab on this issue does not undermine this principle, for they differ as to whether it occurred coincidentally; they say, rather, that it occurred deliberately.
The correct view is that the funeral prayer may be offered for an absent deceased person even after a month, and likewise at the grave even after a month has passed.
Some scholars, however, have qualified this with a sound condition: the person buried must have died at a time when the one offering the prayer was eligible to offer the funeral prayer.
For example, if a man died twenty years ago, and someone who is now thirty goes out and offers the funeral prayer for him, it is valid, because he was ten years old when the deceased died and was thus eligible to pray over the dead.
Another example: if a man died thirty years ago, and someone who is now twenty goes out to pray over him, it is not valid, because the one praying did not exist when the man died and was therefore not eligible to pray over him.
Accordingly, it is not legislated for us to offer the funeral prayer at the grave of the Prophet ﷺ, nor