We live in a very small town so our policies are probably different than those in large cities, especially since the children's librarian knows just about every kid that walks through the door. Kids 3 and under have to have a parent in the same room with them, kids 4-7 need to have a parent in the building, and kids 8 and up can be there alone so long as the librarian has the parent's contact information. And although she knows the policies she also knows most of the kids well enough to know who can/needs to be an exception on both side- there are kids who despite being old enough are not mature enough to be there alone and there are kids that are not old enough who do fine on their on their own.
It's been 23 years since I was 9 so things have changed quite a bit but my mom used to leave myself and my 7yr old brother alone in the kids section of the main downtown branch of the Multnomah County Library while she would get her hair cut and run a few errands. We were probably there 2-3hrs at a time. We loved it and never strayed as far as I can remember. I think I was 12 or 13 though before she let me take the bus there by myself.