The Messenger of Allah ﷺ said, "Spend, and do not count, lest Allah count against you. Do not hoard, lest Allah withhold from you."
أن رسول الله ﷺ قال: أنفقي، ولا تحصي، فيحصي الله عليك، ولا توعي فيوعي الله عليك.
Bukhari narrated it in the Book of Gifts (2591) and Muslim in the Book of Zakat (1029), both through Hisham bin Urwa, from Fatimah bint Munzir, from Asma bint Abu Bakr, and he related it, with the wording being Bukhari's, while Muslim's wording is similar.