Sayyidah Aishah (may Allah be pleased with her) says: I asked the Messenger of Allah (peace and blessings be upon him) about looking around in prayer, and he (peace and blessings be upon him) said: "It is a snatching by which Satan snatches away from a servant's prayer."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3529
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
Sayyiduna Abu Dharr (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) said: "As long as the servant does not look around in prayer, Allah Almighty remains turned towards him, and when he turns his face away, Allah Almighty also turns His attention away from him."
A narration with the same meaning is also reported from Sayyiduna al-Harith al-Ash'ari (may Allah be pleased with him).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3532
Sayyiduna al-Harith al-Ash'ari (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) said: "Allah Almighty sent revelation to Yahya bin Zakariyya (peace be upon him), so he stood up, praised Allah and extolled Him. Then he said: Allah has commanded you to pray, and when a person stands for prayer, Allah Almighty turns towards him, so let no one turn his face away from Him. When the servant turns his face away, Allah Almighty also withdraws His attention from him."
Abu Tawbah narrated this from Mu'awiyah, and in it is: "When you set your faces (towards the qiblah), do not look around."
Yahya bin Abi Kathir narrated the same through Zayd bin Sallam: "When you stand for prayer, do not look around."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3533