The Messenger of Allah ﷺ said, "When Ramadan arrives, the gates of mercy are opened, the gates of Hell are shut, and the devils are chained."
قال رسول الله ﷺ: إذا كان رمضان فتحت أبواب الرحمة، وغلقت أبواب جهنم، وسلسلت الشياطين.
Bukhari related it in the Book of the Beginning of Creation (3277), and Muslim in the Book of Fasting (2:1079), both through Ibn Shihab, who said, "Nafi bin Abu Anas, the freed slave of the Taymi family, told me that his father told him that he heard Abu Hurairah," and he mentioned it.The wording given is that of Bukhari, and Muslim's wording is similar.