"A warning: If you rip, tear, shred, bend, fold, deface, disfigure, smear, smudge, throw, drop, or in any other manner damage, mistreat, or show lack of respect towards this book, the consequences will be as awful as it it within my power to make them."
-- Irma Pince, written inside a library book
The Hogwarts library contains tens of thousands of books on thousands of shelves (PS12). Included in its many sections is an Invisibility Section (CS11), a section with information about dragons (PS14), and a Restricted Section at the back, set off with a rope. A signed note from a teacher is required to peruse that section of the library; it contains books of Dark Magic only used by older students studying advanced Defence Against the Dark Arts. One of the books in this section screams when opened (PS12).
The library books have various spells on them to prevent students from defacing or stealing them (QA). Chocolate (and presumably other food) is forbidden in the library (OP29). Madam Pince is the kind of librarian who sees herself as the guardian and protector of the books, at odds with the students who try to use them. Her demeanor does not suggest that she would be very helpful. In fact, when Hermione, Ron, and Harry were looking for information about Nicolas Flamel, they decided they wouldn’t even ask her. Research must be very difficult in the Hogwarts library.
The library closes at 8 pm (GF20).
Students may place books on hold; during the Basilisk attacks in 1992 - 1993, the book Hogwarts A History had a two-week waiting list (CS9).
Hermione could get a book out of the restricted section by obtaining a signed note from Professor Lockhart. She took out Moste Potente Potions and kept it out for months.
Hermione actually tore a page out of a library book about magical creatures. She was found Petrified with the page clenched in her fist. The page described the Basilisk.
Snape told Harry that it was against the rules to carry a library book out of the castle (PS11). He probably just made that rule up on the spot to get Harry into trouble, however.
For PS film, the Bodleian Library at Oxford was transformed into the Hogwarts School library.