I read this probably in the 1990s but it could have been written earlier. It was probably in an anthology and in English.
The story is about a person, probably a man, who is in some kind of stasis or suspended animation on a spaceship for a long voyage. I think there were hundreds of other crew/passengers but they all remained asleep.
The protagonist 'woke up' and was aware and conscious but still in stasis. I think initially he is just reliving some experience from his life but then realises he is actually on board the ship. He finds out from the ship's computer that he is stuck in this mentally awake but physically asleep state and willbe for the hundreds? thousands? of years of the remainder of the voyage and the computer has decided to try to keep him sane by replaying his memories.
I seem to remember it ended there, no happy ending but more the horror of imagining the next centuries to come.