Players buy guitar parts for a variety of reasons. Like anything, guitar parts can break. It happens. Output jacks can stop working. Tuners can start to slip. Often times though, players will want to replace parts just to upgrade to something of higher quality. Here are some common parts that often need to be replaced or are part of "elective surgery," so to speak.
(1) Pickups - a guitar's pickups are one of the most common parts that players choose to replace. Sure, sometimes a pickup will just die, but more often than not, players simply want to try out a different sound, especially on inexpensive guitars. Pickups are a relatively inexpensive addition to an instrument and can dramatically improve a guitar's tone.
(2) Tuning machines - Again, this is a common replacement on not only inexpensive instruments, but even quality stock instruments. For example, I swear by locking tuners and put them on every guitar I can. I have used Kluson vintage-style locking tuners on a Les Paul and PRS McCarty for years. They keep the classic, vintage look, but have the modern convenience of locking tuners for tuning stability.
(3) Strap Buttons - Nearly every guitar I own has Schaller strap buttons so I can use their locking system (I only own a few guitar straps, all using the Schaller strap loocks). I prefer Schallers myself because of both their reliability as well as aesthetic appeal (and they're easy to use without strap locks if necessary). Dunlop and other companies make equally good locking systems. I just prefer the Schallers. And still others swap out the strap buttons for purely aesthetic reasons.
(4) Nut - On inexpensive guitars especially, a nut may be plastic or not cut right, causing tuning and tonal issues. Many players opt for graphite nuts or other synthetic materials to improve tuning. And there are still many players who prefer a high quality bone nut or even brass.
(5) Volume/Tone Pots - While volume and tone pots are generally acceptable in most off-the-shelf instruments, in lower cost instruments a rewiring and pot replacement may improve both the tone and noise level. Some players will also modify their stock instruments with push-pull pots that may split a pickup from humbucker to single coil or provide other modifications.
(6) Bridges - Another common upgrade, especially on lower quality instruments, is either a complete bridge replacement or replacing bridge components. Such modifications can improve tone, sustain, and tuning stability. There are after-market replacements for both acoustic and electric guitars.
Most major music retailers sell replacement parts such as tuning machines, strap buttons, pickups, bridges, and other guitar parts. One of the best places to find such parts is on eBay, where you'll find parts on sale from both major retailers and smaller retailers, but a wide range of products regardless.
Always check the return policy, especially of items like guitar pickups. You might consider purchasing the parts used on eBay, so that if they don't work out the way you want, you can always sell them and likely for the same price you paid for them.