It’s cheaper to repair it, but you will likely have to replace it. Typically the problem is with the latching mechanism and you are limited with what you can do to it. At a minimum, you can take the latch apart, clean and lubricate it, then see if it works any better.
You should inspect the handle to find out if the problem is actually with the latch or with the keep. Your problem may be simply that the keep needs to be adjusted up or down. The keep is located on the side jamb of the door and has a recess in it to accept the latch. Some keeps are part of the frame, and a surface mounted handle latches into it.
The latch movement is controlled by a lever or knob on the handle, and the keep is stationary.
The latch will either be part of the handle, or it will be recessed inside the frame of the door. The recessed type is the most expensive.
For surface-mounted handles, that is, where the door frame is sandwiched between the two parts of the handle, there really are no parts to change. Go buy a new handle (this type has the latching mechanism built into it). Replacing this type of handle is nothing more that removing two screws. Just unscrew them, take the handle to the home center and screw the new one back in place.
The new handle will include two lengths of screws which will fit different widths of door frames. The door frame will have holes cut into it to receive the screws. Just hold the two pieces of the handle on either side of the door’s frame, slide the screws through the frame and tighten the screws.
After you install a new handle, you may need to adjust the keep (if it’s not built into the frame). The keep is held in place with two screws and has elongated holes to allow for up and down movement. Loosen the screws and adjust the keep until the latch locks into it.
The most challenging patio door components to replace are the mortised components. These are the ones you want to repair because finding parts can be difficult.
Mortised components are recessed into the door’s frame. The handle has a knob with a piece that fits into the mortised latch assembly. Rotating the knob moves the latch out of the recess and into the keep.
To work on the mortised latch, you will first need to remove the handle assembly. Remove the mortised latch assembly by unscrewing it from the edge of the door’s frame.
The mortised latch is shaped like a hook that, when you rotate the lever, exits the mortise and rises up to engage the keep. Clean this assembly, lubricate it and see if it works. If the parts are too worn, you will have to take it to a home center, but the selection is extremely limited. You may have better luck at a lock shop, or you can order parts over the Internet (try http://www.hawkretrofit.com/).
Once you have a working latch, slide it into the mortise and screw it in securely. Reinstall the handle assembly and test it to see if it works properly.
You can adjust the keep of course, but you can also adjust the hook if it doesn’t come out far enough. Right above where the hook exits the mortise is an adjustment screw. Rotate the screw to adjust the hook and go enjoy the rest of your weekend.