“The Messenger of Allah ﷺ said: ‘Do not lift your gaze to the heavens lest your sight be snatched away,” meaning during prayer. (Using translation from Ibn Mājah 1043)
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ «لَا تَرْفَعُوا أَبْصَارَكُمْ إِلَى السَّمَاءِ أَنْ تُلْتَمَعَ» يَعْنِي فِي الصَّلَاةِ