The Prophet ﷺ said, "Hospitality is for three days, and whatever is beyond that is charity."
حدثنا يحيى عن محمد بن عمرو قال حدثني أبو سلمة
عن النبي ﷺ قال إن الضيافة ثلاثة فما زاد فهو صدقة
Its chain of transmission is sahih. Hakim reported it with this wording (4/164) and graded it sahih, and Dhahabi agreed with him. Ibn Abu Shayba also reported it (12/477, no. 15319) in the chapter on jihad, and it was graded sahih in Majma (8/176), which did not attribute it to Ahmad. Bukhari reported something similar (8/13) in the chapter on manners, "Whoever believes in Allah and the Last Day should not harm his neighbor," and Muslim also reported it (3/1353, no. 48), in the chapter on lost property, section on hospitality.