Some of them have a backpack-sized locker under/next to the bunks, where either you'll have to use your own lock or they provide one. Others have banks of high-school style lockers.. yet others have a luggage room that's usually secured with one key that you check out from the front desk... it varies a lot, really.
It's best to be prepared by taking at least one combo lock (that way you don't lose the key) with a long shackle (that way it fits anything) as well as a thin cable lock (I use a Demon snowboard lock)
to secure your backpack to fixed objects if need be. Little locks for the zippers and such are cool, but remember not to put them on until you reach your destination, as many airlines will need to be able to open your bag if absolutely necessary.