"You need to learn how to deal with standard locks." ― Vinny
The lockpick minigame requires the player to use the pick to knock a pin to the bottom of its chamber. This can sometimes happen on the first try, or it may take several before the spring relents. Once the pin is at the bottom of the chamber, the action button must be used to secure it in place.
When all the pins are down, the plug turns and the door/gate can be opened. Unlocking gates on the sidewalk can be considered a highly suspicious activity by passersby. Make sure that the thief is in no one's line of sight beforehand.
Bug: If a door is left open and the police are called, the thief will have to pick the lock again before the door can be closed.