Think of it like seats on a bus.
As you open connections, you fill up those seats - eventually, the bus is full and can no longer accept passengers (or open more database connections). Any time the bus has to refuse a passenger because it's at capacity, that passenger has to wait for another bus to come by.
By closing your connections when you're done with them, you free up room for more connections - which means more programs that need to interact with the database can do what they need to, without having to wait around for connections to free up. Not closing your connections means the database needs to figure out what to do with all the connections sitting around, which can cause problems if your database isn't closing connections as quickly as you're opening new ones.
This changes when you're using a connection pool (see comments below); in those situations you'll want your pool to handle opening and closing connections for you. If you're not pooling your connections, keeping them open any longer than you need to is wasting resources.