Sahih Bukhari Volume 5, Book 58, Hadith Number 190.
Narated By Ibn ‘Abbas : Allah’s Apostle was inspired Divinely at the age of forty. Then he stayed in Mecca for thirteen years, and then was ordered to migrate, and he migrated to Medina and stayed there for ten years and then died.