Maintenance is key to keeping your bike in top shape.
Clean
Dirt gets into moving parts and wears them down. A quick rinse after a dirty ride will get most of it off, but avoid blasting water into any bearings. It's an opportunity to inspect the bike for any issues with the frame or parts and take care of them before it fails.
Bolts
Make sure the bolts on your bike aren't loose. Check the stem and headset, seatpost clamp, derailleurs, crankset, etc. Torque bolts to spec during assembly and double check periodically.
Chain
Your chain should get cleaned and lubed regularly. Not only will this optimize performance, but will reduce wear on your entire drivetrain. The chain elongates as it wears, and the chainring and sprocket will wear down to match the stretched contact points. If you run a worn chain too long, you will eventually have to replace everything.
Tires
Check your tires before riding. Look up optimal tire pressure for your weight and tire size to minimize rolling resistance. Make sure there are no bits of glass or metal that could drive themselves deeper as you ride. Check for sufficient thread and the rubber/sidewalls are not cracking.
Wheels
Your wheels should turn smoothly, without wobbling. Truing your wheels takes time to learn, but a worthwhile skill to have. Clean and lube cup and cone bearings regularly and they will last a long time. Too much dirt, not enough lube, or incorrect tension will quickly damage the bearing races. The wheel should have no play in the hub when mounted on the bike, but a tiny bit is what you want before tightening the quick release.
Truing
Your wheels should spin straight.
If they are not, they can be trued by adjusting spoke tension.
Use a zip tie on your frame, or a truing stand for accuracy.
Hubs
Hubs are externally quite durable, but check for cracks around the spoke holes.
Cup/Cone Bearings
Cup and code style hubs should have clean grease. Repack when necessary.
Replace cups when pitted or showing signs of excessive wear.
Replacement axles often include cups and nuts.
Ensure the dust seal is intact, with a light layer of grease inside it.
Cartridge Bearings
Replace or clean bearings when they no longer spin freely.
Axle
Quick Release
Correct preload allows cup/cone bearings to spin freely, without play.
Quick release skewers need to be tightened to apply preload.
Use a vice with an axle insert for easier adjustment.
Rims
Check rims for cracks, especially around spoke holes.
Check rim brake track thickness and concavity.
Shifters
Most shifters are not designed to be taken apart. If they get gummed up, you can spray in some degreaser, but make sure to follow up with some silicon spray lube and work it into place.
Cables
Ensure proper tension for good shifting, and replace damaged cables. Check bare cables for dirt where they enter the housing, clean and lube for best performance. Old housing can get cracked or kinked, but should last a long time otherwise.