Well, there is the universal legend of the draft of forgetfulness (Lethe, in Greek myth?), but that could just be that ghosts can’t remember.
I would assume so, in Heaven, at least after the bodily Resurrection–hard to say, about the minds of disembodied spirits. How much of memory is brain, and how much mind?
As to Hell, I doubt it–even if their memories are restored perfectly at the Resurrection, they’ll still delude themselves. That’s what humans do when they sin.
Forgetting and misremembering are luxuries, by the way, that demons lack–they don’t think, per se, so there’s no way they can believe in anything, even a falsehood. Hell’s much worse for demons, and worst of all for Satan, since he’s got the most intellect to devote to how nasty hell is.