There's a few of these in some aspects...
* A Nightmare on Elm Street (NES) -- Players will "fall asleep" & confront Freddy Kruger throughout the game.
* Little Nemo: The Dream Master (NES) -- Based on the cartoon series "Little Nemo" (which happens to be in public domain nowadays) involves Nemo's adventures in the mythical realm of Slumberland... which he seems to enter in his dreams (as thing are a bit ambiguous in this regard).
* Super Mario Bros. 2 (US ver.)(NES) -- While originally a reskin of the FDS game Doki Doki Panic, the game plays within the dream of Mario as he & friends (Luigi, Peach & Toad) explore the world of Subcon to defeat the evil ruler Wart.
* To the Moon (PC / Steam) -- This indie game (made in RPG Maker XP) has you tasked with implanting the artificial memory of dying people to have their "wish fullfilled" by having the person's mind fill in the blanks after the implant in order to have them die without regrets. HOWEVER, the implanted memory doesn't go as planned & you have to follow the person's life events in the process.
* Catherine (PS3, XBox 360, PS4, PS Vita & PC / Steam) -- A spin-off from the Persona series that has game elements occuring in dreams.
* Adventures of Tom Sawyer (NES) -- Tom falls asleep & dreams of his adventures throughout the game. (You wake up when you hit a Game Over OR complete the game)
* Daydreaming Davey (NES) -- An action/adventure game where you play within the daydreams of the protagonist.
* The Legend of Zelda: Link's Awakening (GBY / GBC / Switch) -- [WARNING: PLOT SPOILERS... I'll try to keep things vague, but the game is 25 years old... so you had time on this] Link wakes up on the mysterious isle of Koholint Island after lightning hits the ship during a nasty storm. During gameplay, you find out that the island is only a dream & the only way to leave is to awaken the dreamer.
There's bound to be other games that have some dream state stuff, but I hope this provides a little primer on the subject matter.