This is going to sound really weird, but whether or not you consider Cyberpunk 2077 to be based on a book is going to depend on your definition of “book.” If you’re asking if it’s based on a novel, then no. The plot in Cyberpunk 2077 was developed specifically for the game and was not borrowed from any other media.
However, if you expand the definition beyond just a work of fiction, then yes, Cyberpunk 2077 is based on a book. More specifically, it’s based on the series of tabletop RPG rulebooks initially created by Mike Pondsmith. These aren’t strictly narrative books, as the stories are meant as a framework to create your own stories with friends based on RPG rules. However, certain characters, concepts, and the setting itself are all taken from these books.
The first Cyberpunk TTRPG rulebook was published in 1988 and is simply called Cyberpunk. It’s now colloquially referred to as Cyberpunk 2013. In 1990, it was followed by an updated ruleset known as Cyberpunk 2020. The most recent version of the TTRPG was published in 2020 under the title Cyberpunk Red. In between these rulebooks were a number of sourcebooks that further expanded on the setting and concepts.
So, while Cyberpunk 2077’s narrative is wholly unique to the game itself, the narrative is set within the Universe established in the Cyberpunk rulebooks and uses concepts, characters, and locations from them.