The Messenger of Allah ﷺ said, "Each of you remains in prayer as long as the prayer is what keeps him there, with nothing but the prayer preventing him from returning to his family."
و حدثني عن مالك عن أبي الزناد عن الأعرج
أن رسول الله ﷺ قال لا يزال أحدكم في صلاة ما كانت الصلاة تحبسه لا يمنعه أن ينقلب إلى أهله إلا الصلاة