On iPhone/iPad, where are the screenshots of terminated apps stored?
They survive a restart so they canonically exist in storage.
Of course, everything you see on screen has to be in RAM, too; so the answer is both.
I forgot the precise location, but they are either stored in the data folder of the application, or the app's cache folder in the filesystem (probably was both on iOS 9 – can't speak for newer iOS versions). This is possible to see if you have read access to the filesystem (such as when you are jailbroken)