There is a kiosk (down every row, I believe) to pay for one of three sizes of locker. We normally get one of the middle-sized ones. I always pay with my credit card and can't remember if they accept other forms of payment or not. Then it prints out your receipt with your locker number on it.
You can go in and out of it as many times as you want until park closing. I can't remember exactly how much they cost (someone chime in if they know it by heart!), but I don't find it expensive.
We always bring jackets for later and stuff them into lockers as soon as we get into the parks.