Yelena Bonner, wife of Nobel Peace Prize laureate Andrei Sakharov, has written a 70,000-word memoir of their lives in internal exile in the Soviet Union, which will be published by Alfred A. Knopf in October.

Written while Bonner was on a six-month exit visa in the United States and Italy for eye and heart operations, the book describes in sometimes gruesome detail the ordeal of harassment, hunger strikes and isolation the couple have suffered in the closed city of Gorki, to which they were banished in 1980 after speaking out on human rights, said Tatiana Yankelevich, Bonner's daughter, in an interview today.

"She felt this might be her last word said in freedom," Yankelevich said. "She felt compelled to write this book because there were a lot of things she wanted to pour out of her heart."

Bonner's sense of urgency is evident in the book, in which she writes: "I had not noticed how my manuscript was growing thicker and my pile of blank paper growing thinner. But I have not said everything I wanted to say. That is still to come -- today or tomorrow, but in any case, very soon. I cannot put it off for long, because everything I want to say I must say before June 2. That is the term of my freedom to speak."

Bonner, a 63-year-old physician, returned to the Soviet Union June 2 to rejoin Sakharov, a celebrated physicist who helped develop the Soviet Union's hydrogen bomb and became one of the country's most prominent dissidents.

"Yelena Bonner Sakharov is one of the great women of the world in her own right," said Robert L. Bernstein, chairman and president of Random House, which owns Alfred A. Knopf. "With Andrei Sakharov, she stands for the right of a human being to express her own feelings, and has done this at tremendous personal sacrifice."

Although it will certainly be seen as an embarrassment and provocation to Soviet authorities, the book comes at a time, Bernstein noted, when Soviet leader Mikhail Gorbachev "is trying to have an image of openness . . . He doesn't want to be seen as a bully."

*To obtain her visa last December, Bonner had to sign an agreement not to give interviews or publicly criticize Soviet policy while abroad. While she was here, however, she gave several interviews, spoke out at a press conference and published two articles, drawn from her book manuscript, in The Washington Post's Outlook section.

Upon her return to the Soviet Union, Victor Louis, a Soviet journalist and a source of official Soviet information about the Sakharovs, said Bonner's outspokenness had "jeopardized" the possibility of an early end to the couple's exile. Before leaving Moscow for Gorki two weeks ago, Bonner said she planned to return to the capital to pick up her luggage on June 15. Yankelevich said her mother failed to appear on that date and must have been prevented from doing so. "We were hopeful that her condition and that of Dr. Sakharov would be eased somewhat after her return, but this is discouraging," Yankelevich said.

Bernstein, a longtime human rights activist who has known Bonner since 1975, said Alfred A. Knopf will print at least 100,000 copies of the book, which will be published simultaneously in the United Kingdom, France, Germany, Italy, Denmark, Norway and Sweden. Negotiations in other countries are under way, he added.

Bernstein and Yankelevich declined to say how much Bonner was paid for the book. However, Yankelevich said that her mother gave part of the advance to her son, Alex Semyonov, for a down payment on a four-bedroom home in Westwood, Mass. With the money, Yankelevich said, Bonner "felt independent and self-supporting. It gave her a good feeling . . . She did not take any back to the Soviet Union because she didn't feel like it."

Semyonov and Yankelevich, who lives in Newton, Mass., are Bonner's children by a previous marriage. Bonner's 85-year-old mother and three of her grandchildren also live in the United States. In Bonner's book, which was written in Russian and is now being translated, "some pages are quite shocking," Yankelevich said. "I don't want to go into the gruesome details -- the readers will see for themselves." But she added that Bonner describes the force-feeding of Sakharov during his hunger strikes, the anguish of being prevented by the KGB from visiting her husband in the hospital, and the KGB's secret videotaping of the couple's most private moments.

Yankelevich said part of the book is about Bonner's six months abroad and her distress at having to leave her family to return to Gorki. It describes meetings with British Prime Minister Margaret Thatcher and French President Franc,ois Mitterrand and reflects her disappointment at not being permitted to meet with President Reagan.

Asked whether Bonner believed she was taking a risk by writing the book, Yankelevich said, "Her position is she's always taking risks by virtue of being herself. But she felt obliged to make known what has happened to them."

Yankelevich said it was Bonner's idea to write the book and that she had done it without help. Edward Kline, a family friend who spent six days with Bonner in the Virgin Islands, said she was up typing late each night.

"It is a very human account," Kline said. "It does not have startling revelations, but it is a well-written book by someone who has had a unique life experience, who has lived with Sakharov, a scientist of unique moral authority. It is also a love story of deep feeling."