This is reported from the Messenger of Allah ﷺ in the long hadith of intercession, which includes the following. Allah will say, "Go, and whoever you find with the weight of a dinar of faith in his heart, bring him out."Abu Saeed said, "If you do not believe me, then recite, 'Indeed, Allah does not wrong even the weight of an atom, and if there is a good deed He multiplies it' [Nisa 4:40]."In another narration, "Bring out whoever has in his heart the weight of a mustard seed of faith."
عن رسول الله ﷺ في حديث الشفاعة الطويل وفيه: فيقول عز وجل: اذهبوا، فمن وجدتم في قلبه مثقال دينار من إيمان فأخرجوه قال أبو سعيد: فإن لم تصدقوا فاقرؤوا: {إن الله لا يظلم مثقال ذرة وإن تك حسنة يضعفها} وفي رواية: أخرجوا من كان في قلبه مثقال حبة من خردل من إيمان.
Bukhari related it in the Book of Tawhid (7439) and Muslim in the Book of Faith (183), both from the hadith of Zayd bin Aslam, from Ata bin Yasar, from Abu Saeed, who narrated it. The wording given is that of Bukhari. In Muslim's wording it reads, "Whoever you find in his heart the weight of a speck of good."