The Messenger of Allah ﷺ said, "Allah, glorified is He, says, 'I am as My servant thinks of Me, and I am with him whenever he remembers Me. If he remembers Me within himself, I remember him within Myself. If he remembers Me in a gathering, I remember him in a better gathering. If he draws near to Me by a hand's span, I draw near to him by a forearm's length. If he comes to Me walking, I come to him at speed.'"
حدثنا أبو بكر بن أبي شيبة وعلي بن محمد قالا حدثنا أبو معاوية عن الأعمش عن أبي صالح
قال رسول الله ﷺ يقول الله سبحانه أنا عند ظن عبدي بي وأنا معه حين يذكرني فإن ذكرني في نفسه ذكرته في نفسي وإن ذكرني في ملإ ذكرته في ملإ خير منهم وإن اقترب إلي شبرا اقتربت إليه ذراعا وإن أتاني يمشي أتيته هرولة
Muslim narrated it in Sahih Muslim, Remembrance and Supplication, chapter on encouragement to remember Allah Most High (and the preceding chapter), 21/2675, from Ibn Abu Shayba with this chain.