If you are referring to ANY public library, it is not capitalized.
I went to the public library today.
The public library is often open in the evenings in big cities.
If you are referring to a specific public library, it is capitalized.
I went to the New York Metropolitan Public Library.
The Toronto Public Library had the book I needed.