"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.
How do we know that the library is located on the fourth floor? From this passage from PS12:
A piercing, bloodcurdling shriek split the silence -- the book was screaming! Harry snapped it shut, but the shriek went on and on, one high, unbroken, earsplitting note. He stumbled backward and knocked over his lamp, which went out at once. Panicking, he heard footsteps coming down the corridor outside -- stuffing the shrieking book back on the shelf, he ran for it. He passed Filch in the doorway; Filch's pale, wild eyes looked straight through him, and Harry slipped under Filch's outstretched arm and streaked off up the corridor, the book's shrieks still ringing in his ears.
He came to a sudden halt in front of a tall suit of armor. He had been so busy getting away from the library, he hadn't paid attention to where he was going. Perhaps because it was dark, he didn't recognize where he was at all. There was a suit of armor near the kitchens, he knew, but he must be five floors above there (PS12).
Five floors above the kitchens would be the fourth floor.
For PS film, the Bodleian Library at Oxford was transformed into the Hogwarts School library.