I read this story in a sci-fi anthology in the mid 90s, but I remember thinking the book looked pretty old by then.
The story is about a man who wakes up from stasis / cryogenic sleep in the future, only to discover that he's the only human left alive on Earth. He's greeted by a simple robot which is programmed to follow his instructions. He spends some time in the library, but eventually decides to go back to stasis. Before he does, he gives the robot an order, which it interprets to mean that it should expand its own capabilities.
When the man wakes up again next time, many years have passed, possibly centuries, and the robot is noticeably smarter, having gained several extensions and upgrades. For some reason, the man goes back to stasis.
That keeps happening a few times, the man goes in and out of stasis, and every time he wakes up the robot has upgraded itself. Eventually the man gets so depressed about being the only human left that he decides to go back to stasis permanently.
The next time he wakes up, billions of years have passed and Earth is about to end. The robot, who by now is on the far side of the singularity, ushers him into a spaceship and puts him back to sleep.
The man wakes up a final time,
on a planet full of humans. The robot has spent the time when he was in stasis to find a new planet, terraform it, and create human beings to populate it. The twist is that everyone has a green tint, because they were modeled on a discolored picture of the man's wife, that he had in his wallet. The man decides he's fine with this.
I can't remember exactly why all the other humans were dead, could have been a war or a plague or something similar. I also can't remember why he went in and out of stasis, it could have been that he gave the robot a project to complete that would take a long time, and only woke up to check on its project.