The Messenger of Allah ﷺ said, "Allah says, 'I am as My servant thinks I am, and I am with him whenever he remembers Me. If he remembers Me within himself, I remember him within Myself, and if he remembers Me in a gathering, I remember him in a gathering better than the one in which he remembered Me. If the servant draws a hand's span nearer to Me, I draw a forearm's length nearer to him, and if he draws a forearm's length nearer to Me, I draw an arm's span nearer to him, and if he comes to Me walking, I come to him hurrying.' To Him belong all favor and grace."
وبهذا الإسناد قال رسول الله ﷺ إن الله عز وجل يقول أنا عند ظن عبدي بي وأنا معه حين يذكرني إن ذكرني في نفسه ذكرته في نفسي وإن ذكرني في ملإ ذكرته في ملإ خير من ملئه الذين يذكرني فيهم وإن تقرب العبد مني شبرا تقربت منه ذراعا وإن تقرب مني ذراعا تقربت منه باعا وإذا جاءني يمشي جئته أهرول له المن والفضل
Its chain of transmission is sahih. It has already appeared at 9711.