From Sahih Bukhari (Hadith 6445):
Narrated Abu Huraira:Allah's Apostle said, "If I had gold equal to the mountain of Uhud, it would not please me that anything of it should remain with me after three nights (i.e., I would spend all of it in Allah's Cause) except what I would keep for repaying debts
Reference: Bukhari 6445