The Prince George's County Council yesterday enacted legislation forbidding retail stores to sell "obscene matter" including such magazines as Playboy and Penthouse to juveniles. It also requires that such material be kept under the counter.

The bill was passed by 9-to-1 vote after a lengthy public hearing and a long debate over the definition of "obscene matter."

The definition became a key factor in the debate last month after the council added an amendment to the bill that would have included libraries and schools in the ban on allowing juveniles access to "obscene matter."

Yesterday representatives from county libraries and schools vigorously protested such a ban, saying that the law could be interpreted to include scientific books and works of art.

An amendment proposed by council member William B. Amonett and passed by the full council yesterday afternoon after a long debate exempted the libraries and schools from the ban.

The council also approved an amendment proposed by council member Francis B. Francois defining as "harmful to juveniles" any work that, as a whole, ". . . appeals to the prurient interest of a minor and lacks serious literary, artistic, political, educational or scientific value to a minor."

Prior to the passage of the bill, 24 public speakers addressed the subject, many of them representing the county library and school systems. Before these speakers began, Francois produced a copy of Penthouse magazine, which he said he had purchased yesterday morning.

"I've marked a number of pages with paper clips," he said. "If you glance through them, you'll see exactly what I mean by obscenity."

Council Chairman Francis W. White picked up the magazine and as he leafed through it, Francois noted, "I see the chairman will be the first to examine this document."

Laughing, White answered, "Well, judging by the number of paper clips here, you've done an extremely thorough job of perusing the magazine."

Most of the more than two hours of public hearing were more serious than that exchange, however. Later, Francois told Charles W. White, chairman of the library board of trustees, and library administrator William Gordon that he was distressed by "inaccuracies," in a letter sent out by the library opposing the bill.Tr for add 11

Council members questioned Gordon at length on the type of materials available in public libraries. Council member Samuel W. Bogley became particularly upset on learning that Playboy magazine was available in public libraries.

"Do you have any more surprises like this in store for us?" Bogley asked Gordon.

Gordon also had to defend the library's use of the book, "Our Bodies, Ourselves," a 1976 book about the female body.

Council member Frank P. Casula said he had examined the book and decided that it was a book "ford those other than normal people. It's a trashy book," he declared. "I mean, it's worse than Hustler or Penthouse. It goes through everything you want to know . . ."