Sayyiduna Abu Dharr (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: "As long as a person does not look around while in prayer, Allah Almighty remains turned towards him, and when he looks around, Allah Almighty also turns His attention away from him."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3531