This answer applies to FAA certified aircraft. For experimentals, there are really no restrictions. I mean, you can build the airplane from scratch so replace what you want... but for certified aircraft:
FAR Part 43 specifies who may do what to an aircraft in the way of maintenance, repair or alteration. It requires that only properly certified mechanics work on aircraft and "okay" them for return to service. However, it does allow preventive maintenance to be performed by a certificated pilot, holding at least a Private certificate, on an aircraft owned or operated by that pilot, provided the aircraft is not used in commercial service. The responsibilities for a pilot performing preventive maintenance are very similar to those imposed on the certificated mechanic performing other duties. The FARs require that anyone who works on an aircraft must have the appropriate maintenance and service information available. This means quite simply that before you set about performing preventive maintenance items on your airplane, you must first have the proper maintenance manuals available.
A list of "preventive maintenance" allowed is specifically listed in FAR 43 appendix A (4) c and is copied below:
Preventive maintenance. Preventive maintenance is limited to the
following work, provided it does not involve complex assembly
operations:
(1) Removal, installation, and repair of landing gear tires.
(2) Replacing elastic shock absorber cords on landing gear.
(3) Servicing landing gear shock struts by adding oil, air, or both.
(4) Servicing landing gear wheel bearings, such as cleaning and
greasing.
(5) Replacing defective safety wiring or cotter keys.
(6) Lubrication not requiring disassembly other than removal of
nonstructural items such as cover plates, cowlings, and fairings.
(7) Making simple fabric patches not requiring rib stitching or the
removal of structural parts or control surfaces. In the case of
balloons, the making of small fabric repairs to envelopes (as defined
in, and in accordance with, the balloon manufacturers' instructions)
not requiring load tape repair or replacement.
(8) Replenishing hydraulic fluid in the hydraulic reservoir.
(9) Refinishing decorative coating of fuselage, balloon baskets, wings
tail group surfaces (excluding balanced control surfaces), fairings,
cowlings, landing gear, cabin, or cockpit interior when removal or
disassembly of any primary structure or operating system is not
required.
(10) Applying preservative or protective material to components where
no disassembly of any primary structure or operating system is
involved and where such coating is not prohibited or is not contrary
to good practices.
(11) Repairing upholstery and decorative furnishings of the cabin,
cockpit, or balloon basket interior when the repairing does not
require disassembly of any primary structure or operating system or
interfere with an operating system or affect the primary structure of
the aircraft.
(12) Making small simple repairs to fairings, nonstructural cover
plates, cowlings, and small patches and reinforcements not changing
the contour so as to interfere with proper air flow.
(13) Replacing side windows where that work does not interfere with
the structure or any operating system such as controls, electrical
equipment, etc.
(14) Replacing safety belts.
(15) Replacing seats or seat parts with replacement parts approved for
the aircraft, not involving disassembly of any primary structure or
operating system.
(16) Trouble shooting and repairing broken circuits in landing light
wiring circuits.
(17) Replacing bulbs, reflectors, and lenses of position and landing
lights.
(18) Replacing wheels and skis where no weight and balance computation
is involved.
(19) Replacing any cowling not requiring removal of the propeller or
disconnection of flight controls.
(20) Replacing or cleaning spark plugs and setting of spark plug gap
clearance.
(21) Replacing any hose connection except hydraulic connections.
(22) Replacing prefabricated fuel lines.
(23) Cleaning or replacing fuel and oil strainers or filter elements.
(24) Replacing and servicing batteries.
(25) Cleaning of balloon burner pilot and main nozzles in accordance
with the balloon manufacturer's instructions.
(26) Replacement or adjustment of nonstructural standard fasteners
incidental to operations.
(27) The interchange of balloon baskets and burners on envelopes when
the basket or burner is designated as interchangeable in the balloon
type certificate data and the baskets and burners are specifically
designed for quick removal and installation.
(28) The installations of anti-misfueling devices to reduce the
diameter of fuel tank filler openings provided the specific device has
been made a part of the aircraft type certificate data by the aircraft
manufacturer, the aircraft manufacturer has provided FAA-approved
instructions for installation of the specific device, and installation
does not involve the disassembly of the existing tank filler opening.
(29) Removing, checking, and replacing magnetic chip detectors.
(30) The inspection and maintenance tasks prescribed and specifically
identified as preventive maintenance in a primary category aircraft
type certificate or supplemental type certificate holder's approved
special inspection and preventive maintenance program when
accomplished on a primary category aircraft provided: (i) They are
performed by the holder of at least a private pilot certificate issued
under part 61 who is the registered owner (including co-owners) of the
affected aircraft and who holds a certificate of competency for the
affected aircraft (1) issued by a school approved under Sec. 147.21(e)
of this chapter; (2) issued by the holder of the production
certificate for that primary category aircraft that has a special
training program approved under Sec. 21.24 of this subchapter; or (3)
issued by another entity that has a course approved by the
Administrator; and (ii) The inspections and maintenance tasks are
performed in accordance with instructions contained by the special
inspection and preventive maintenance program approved as part of the
aircraft's type design or supplemental type design.
(31) Removing and replacing self-contained, front instrument
panel-mounted navigation and communication devices that employ
tray-mounted connectors that connect the unit when the unit is
installed into the instrument panel, (excluding automatic flight
control systems, transponders, and microwave frequency distance
measuring equipment (DME)). The approved unit must be designed to be
readily and repeatedly removed and replaced, and pertinent
instructions must be provided. Prior to the unit's intended use, and
operational check must be performed in accordance with the applicable
sections of part 91 of this chapter.
(32) Updating self-contained, front instrument panel-mounted Air
Traffic Control (ATC) navigational software data bases (excluding
those of automatic flight control systems, transponders, and microwave
frequency distance measuring equipment (DME)) provided no disassembly
of the unit is required and pertinent instructions are provided. Prior
to the unit's intended use, an operational check must be performed in
accordance with applicable sections of part 91 of this chapter.