Ammar bin Abi Ammar (may Allah have mercy on him) said: I asked Sayyiduna Ibn Abbas (may Allah be pleased with them both): "How old was the Prophet (peace and blessings be upon him) on the day he passed away?" He said: "I did not expect that this would be hidden from someone like you." I said: "I asked about it and received differing answers, so I wanted to know your view on it." He said: "Can you count?" I said: "Yes." He said: "Take forty years, at (the age of) which he (peace and blessings be upon him) was sent as a prophet; and fifteen years of his stay in Makkah, during which he (peace and blessings be upon him) was at times in safety and at times in fear; and ten years (of his stay) in Madinah after the emigration."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12787