ATMs have the ability to function 24 hours a day, seven days a week, and many are open 24/7, but some ATMs do close, usually because they are inside a bank or other location that has closed.
Most banks have an ATM that is open to the outside, so it will be accessible to customers at all hours; this is definitely the norm (and everyone’s preference). But some banks may not have had an outdoor ATM installed, or they may choose to limit the availability of the ATM if the bank location is in a high-crime area where the ATM could be tampered with or even stolen when no one is nearby.
In addition, not every ATM is associated with a bank. It is not unusual to see a free-standing kiosk ATM in a convenience store, bar, casino, or other location that is not always open. Obviously, then, those ATMs would close when the store or other establishment closes.