Laptop connects fine at home but not anywhere else. How can I fix this?

I have a Lenovo laptop that's a couple years old. At home it connects to Wi-Fi perfectly with no issues. I brought it to school and tried to connect but it won't connect to any other Wi-Fi places. It'll show the networks on the list with max strength but when I try to connect it just says error. Also tried it on my phones hotspot. Same thing, it showed up, max strength then didn't connect. What's wrong with my computer?

Password perhaps