The Prophet (peace and blessings be upon him) said:
"You will continue to be counted as in a state of prayer as long as you keep waiting (sitting in the mosque) for the (next) prayer."
Hadith Referenceصحیح الجامع الصغیر / حرف الألف / 2313
Hadith Gradingالألبانی:صحيح
Hadith Takhrij[ن] عن أنس. حم ٣/٢٦٧، مختصر البخاري ٣٦٣، م ٢/١١٦.