The Messenger of Allah ﷺ said, "One of you remains in prayer for as long as it is the prayer that keeps him waiting, with nothing holding him back except his waiting for it."
وقال رسول الله ﷺ لا يزال أحدكم في صلاة ما كانت الصلاة هي تحبسه لا يمنعه إلا انتظارها
A sahih hadith, narrated by Bukhari, volume 4, page 114, from Abdul-Rahman bin Abu Amra, from Abu Hurairah, from the Prophet ﷺ, who said, "Each one of you remains in prayer as long as the prayer is holding him there, and the angels say, 'O Allah, forgive him and have mercy on him,' as long as he has not gotten up from his prayer or broken it." Also narrated by Muslim, volume 1, page 139.... Araj, from Abu Hurairah, that the Messenger of Allah ﷺ said, "Each one of you remains in prayer as long as the prayer is holding him there, and nothing keeps him from returning to his family except the prayer."