Following are the biblical sources: 2 Maccabees 12:41–46; 2 Timothy 1:18; Matthew 12:32; Luke 23:43; 1 Corinthians 3:11–3:15; and Hebrews 12:29.
Catholic Answers explains here: https://www.catholic.com/magazine/online-edition/is-purgatory-in-the-bible