Roman Catholics believe that those guilty of minor sins need purification before they become fit to be with God in Heaven and this purification involves severe torture for a finite period. The Bible does not mention Purgatory but Roman Catholics interpret some passages as referring to it.
If the work which any man has built on the foundation [which is Christ] survives, he will receive a reward. If any man's work is burned up, he will suffer loss, though he himself will be saved, but only as through fire" (1 Cor 3: 14-15). 
There is a similar problem as with the Problem of Hell as to why a loving God cannot purify sinners without inflicting extreme suffering. Roman Catholics pray for the souls of departed loved-ones, they also pay priests to say mass and ease the souls of deceased loved ones through Purgatory.