I have listed all the Castle's and forts explicitly stated as having a library, however from the wealth of libraries we see, we can suppose every major house had a library and most likely (considering the Nightfort has one) most minor houses had libraries to keep their Maesters busy.
From a quote below, we learn from Sam that Castle Black's library of thousands of books is much larger than any has seen before, Jon confirms that Winterfell had "more than a hundred". We can assume Jon to have been more inclined with his sword fighting than reading in his youth and may not have ever known an exact number, however this still suggest that the libraries of lesser houses contained fewer books, possibly less than a hundred.
Castle Black
Castle Black had a library where Sam spent much of his time at the wall, he was sent there to help Maester Aemon and to provide for him. This is where he tried to figure out how he killed the White Walker, before going off to the Citadel.
“Truly. I’m to assist Maester Aemon with the library and the birds. He needs someone who can read and write letters.”
A Game of Thrones - Jon VI
The Castle had a large library, of thousands of books, larger than Winterfell and we can only suppose larger than any of the Castles Samwell visited as a child.
Sam yawned. "Maester Aemon sent me to find maps for the Lord Commander. I never thought . . . Jon, the books, have you ever seen their like? There are thousands!"
He gazed about him. "The library at Winterfell has more than a hundred. Did you find the maps?"
A Clash of Kings - Jon I
Nightfort
Bran, Jojen, Meera and Hodor found a Library among many other things in the ruins that were left of the Nightfort, although there were no books left and the shelves had collapsed
“ They found a library (the shelves and bins had collapsed, the books were gone, and rats were everywhere).”
A Storm of Swords - Bran IV
Winterfell
Winterfell had the Library Tower the Library Tower was burnt down during the attempt on Bran's life to serve as a distraction
Somewhere in the great stone maze of Winterfell, a wolf howled. The sound hung over the castle like a flag of mourning.
Tyrion Lannister looked up from his books and shivered, though the library was snug and warm.
A Game of Thrones - Tyrion I
Fire, she thought, and then, Bran! “Help me,” she said urgently, sitting up. “Help me with Bran.”
Robb did not seem to hear her. “The library tower’s on fire,” he said.
A Game of Thrones - Catelyn III
Oldtown
This is where the Maesters were trained in the knowledges and arts of the world and housed the greatest Library in Westeros.
The old man remained an archmaester only by courtesy. As great a maester as once he’d been, now his robes concealed soiled smallclothes oft as not, and half a year ago some acolytes found him weeping in the Library, unable to find his way back to his chambers.
A Feast for Crows - Prologue
Red Keep
The Red Keep's library was mentioned in A Storm of Swords, Tyrion could be found reading histories there, and Septon Barth, was taken from it's Library by the Old King to become Hand of the King.
“Against this, you have Septon Barth, the blacksmith’s son the Old King plucked from the Red Keep’s library, who gave the realm forty years of peace and plenty.” Pylos smiled. “Read your history, Lord Davos, and you will see that your doubts are groundless.”
A Storm of Swords - Davos V
He was the son of a common blacksmith and had been given to the Faith while young. But his brilliance made itself known, and in time he came to serve in the library at the Red Keep, tending the king's books and records.
A World of Ice and Fire - The Targaryen Kings: Jaehaerys I
Ten Towers
Asha's "Nuncle" Lord Rodrik Harlaw kept a Library and was known as The Reader, he was fond of his books and permited no food or drink in his Library.
Lord Rodrik pursed his lips. “You know I do not permit food nor drink in my library. The books—”
“—might suffer harm.” Asha laughed.
A Feast for Crows - The Kraken's Daughter
Old Volantis
Keen for a History of Volantis Tyrion, an avid reader, supposed there must be a library in Old Volantis which would have a complete copy of The Fires of the Freehold.
What he really wanted was the complete text of The Fires of the Freehold, Galendro’s history of Valyria. No complete copy was known to Westeros, however; even the Citadel’s lacked twenty-seven scrolls. They must have a library in Old Volantis, surely. I may find a better copy there, if I can find a way inside the Black Walls to the city’s heart.
A Dance with Dragons - Tyrion IV
Horn Hill
There was a Library at Horn Hill, seat of Lord Randyll Tarly, Sam is known to have read every book in the library
Jon glanced warily at Chett, standing beside the door, his boils red and angry. “He could help you,” he said quickly. “He can do sums, and he knows how to read and write. I know Chett can’t read, and Clydas has weak eyes. Sam read every book in his father’s library.”
A Game of Thrones - Jon V
Solosh
In the City of Scholars, there was a "great library" which housed a large portion of the history of the Tall Men.
Sallosh by the Silver Shore, City of Scholars, with its vast library and Painted Walls.
A World of Ice and Fire - Beyond the Free Cities: The Grasslands
For scholars and students of history, the fall of Sallosh by the Silver Shore was especially tragic, for when that City of Scholars burned, its great library was not spared, and most of the history of the Tall Men and the peoples who had gone before them were lost for all time.
ibid.