Personally, I spent 10 years in school (6 at the graduate level). My parents were able to pay for my undergraduate education, but I had to pay for my graduate studies. I currently owe more than $70,000 in student loans, and I already paid off at least $30,000. I am an exception. My debt is greater than most people's, but it is not unheard of.
To get a better picture, you can check out this web site http://www.finaid.org/loans/
66% percent of 4 year undergraduate students borrow money for their education, and the average student loan debt among graduating seniors is $23,000.
You can read the tables for graduate level studies yourself. I was personally surprised to see that 35% of PhD students take out student loans, and their average debt is $45,000. I thought that nearly all PhD candidates received free tuition and some sort of stipend, as alefor had stated. I knew this wasn't true for Master's level studies, but I thought it was for a PhD.
Poor people, especially at the undergraduate level, have many ways to pay for their education, although few of the sources cover all expenses. Libraries do have textbooks, but I, personally, don't really like using library textbooks. You can't mark them up like you can your own and there aren't enough copies for every student. But books aren't really that big of a problem, in my opinion. You can purchase used textbooks at significant discounts and now you can rent textbooks, although I don't know how much that costs. Also, you will generally have friends who follow the same degree plan, and so will take the same courses as you, so you can borrow or purchase theirs. Purchasing textbooks is not near the problem (in my opinion at least) as the overall cost of education. And I still consider the educational philosophy in American to be an even greater problem.
It isn't the poor who are denied an education. If they make the grades, they have multiple sources of funding. It is the middle class that gets squeezed out. They usually make too much money to qualify for needs based assistance have to take out loans.
But that's my experience and opinion. Alefor's is obviously different.