Alrighty...here is the jist of it for United on the A320.
The door remains open during the boarding process. After the purser has been given a copy of the pax manifest, and when everyone is safely on board, and all of the luggage has been stowed, the CSR working that flight, will make their final announcements regarding the flight, and walk outside of the aircraft, and close the door.
On the A320, the door is released, and slide into its resting place. Once in place, the handle is pushed downward, and the door is secure.
After the jetway/stairs has been pulled back, the flight attendant at that door will make an announcement over the p.a. that says "Flight Attendants, arm doors for departure." Then, he/she will move the slide arming handle downward. In the photo above, it is the yellow handle towards the left of the door. The door is now armed.
BTW: 777gk...Its not the captain...its the f/a at the door who will announce when it is safe to arm/de-arm the doors.
On the 737, a very simliar process occures, as I wrote above, but a small girt bar is latched down onto the floor. To de-arm the door, you simply remove the girt bar from the floor, and place it on the hooks at the base of the slide pack.
On most airlines, it is a requirement that the 737 doors are "cracked" thus symbolizing that they are safe to open. This way the slide wont be blown accedently from crews trying to open the door from teh outside. On the 757, 767, 747, and the 777, as well with all of the airbus products...the slide will disarm itself when the handle is moved, making it safe to open the door.