There are some "never leave home without 'em" items that every cyclist should carry, that is, unless you like walking home now and then. The essentials include: spare tubes, patch kit, pump, and tire levers. These days I consider a cellular phone an essential too. Besides the tools and spares, you need the knowledge of how to use them properly too. These items are the bare minimum, sufficient to allow you to ride home rather than walk or call for assistance.
Some other useful tools and spares are: a tire boot, Allen keys, a multi-tool, and a spoke wrench with a spare spoke and nipple. A tire boot is used for lining the inside of slashed tire. It simply reinforces the cut area and keeps the tube from blowing out. You can make a boot from a section of old tire, some duct tape, or even a dollar bill - though a paper bill will work only if it stays dry. Allen keys, a Y tool, or a bicycle-specific multi-tool will allow you to tighten most fasteners. Some of the multi-tools come with a chain breaker, allowing you to repair a chain and keep on riding.
Spoke wrenches and a spare spoke may allow you to repair a broken one on the road, but in my experience most broken spokes occur behind the gear cluster, making roadside repairs a problem. If your frame has enough clearance, you can simply twist a broken spoke around one of its neighbors, thereby eliminating it as an impalement hazard. Some racing frames do not have clearance for a wheel with a broken spoke, so a broken one render the bike unusable. But if you’re lucky enough to be able to ride it, be gentle going home and watch for potholes and railroad crossings. Repair it immediately, because the wheel is seriously weakened when a spoke is absent. Be aware, though, that when a wheel starts breaking spokes, it's often a sign that it's near the end of its service life.
Other add-ons might include a zip tie and a first aid kit. Zip ties are handy when some handlebar tape starts to peel off, or if a snap or buckle breaks on a pannier. And if you should happen across a huge adjustable wrench or other found tool along the road, you have a way to carry it! A first aid kit is self-explanatory. Carry one and hope that you never need it.
Obviously, if you're merely going for a day-long ride, you need fewer tools than someone bound for the edge of civilization, say, Borneo, Africa, or Nowata, Oklahoma. Plan accordingly.
Those listed above are the bare minimums. I probably carry more tools than the average cyclist, first, because I tend to break things, and second, because I ride older bikes most of the time. Some tools are for specific bikes or tasks, like my fixed gear commuter. While it would be possible to draw up an ideal list of tools, these are the contents of my bags. I actually emptied them to look! I ride 4 different bikes, so rather than have 4 tool bags, I just move the tools from bike to bike as necessary. You'll notice some redundancy because I often forget just where I stashed a tool, so I add another one. This makes for a heavy pannier!
I carry a single pannier for commuting, almost an oversized briefcase that was originally intended for police use. In the outer pocket, I have a sawed-off piece of shovel handle, my dog re-alignment tool that has been used only once in all the years I've carried it. The tool has a lanyard for easy access. There are two Maglite flashlights, one AA and one AAA. They have the spare batteries for my handlebar lights since I commute in the dark most days. I use the old backpacker's trick of removing one battery and reversing it, so if the flashlight is accidentally turned on, the batteries do not discharge. There's an offset wrench for an old-style Campy "micro-adjusting" seat post. (I fitted a new Brooks Pro recently, and I'm still fiddling with it.) On a mini-carabiner, I have a Campy 15mm 'peanut butter' wrench, and both a 13mm and a 15mm combination wrench. The peanut butter wrench will tighten crank bolts and track hubs, but I prefer a thicker wrench for the hubs because it's easier on my hand. The other items at the bottom of the bag are: Park plastic tire levers, a spare cell phone battery, a set of Allen keys in 1.5 thru 8mm, and a plastic bag. The bag covers my leather saddle and seat bag when the bike is on the rack outside. Trust me, birds like Brooks saddles!
The seat bag contains: 2 spare tubes, a patch kit, a 6" adjustable wrench, steel tire levers, a quick stick, and a Cool Tool wrapped in an old bandana. Again, the 6" adjustable wrench is there to save my hands. But the quick stick and Cool Tool may require some explanation. The quick stick is designed to force thin, high-pressure tires over the rim. It saves my thumbs. Cool Tools may be out of production by now. It's a large, heavy multi-tool made from very hard steel, unlike so many of the newer, smaller multi-tools. Cool Tools have a thin adjustable wrench suitable for pedals; 4, 5, 6, and 8mm Allen keys; a chain breaker, a Phillips head screwdriver, a spoke wrench, and a 14/15mm socket. The Cool Tool is not rustproof, so that's why I carry a plastic bag to cover my saddle and seat bag. Also, I keep this tool and the tire levers wrapped in an old bandana. It prevents the tools from rubbing through my spare tubes and gives me something to clean my hands after a roadside repair.
In my pocket, there's a Schwinn centennial edition spoke wrench, sized for Japanese spokes. It has a bottle opener, too, for those rare occasions when a bottle of beer magically appears in my hand. This particular magic trick seems to occur every day in late afternoon. I have no explanation for it.
I've seen recommendations for matches, a Powerbar, money, a space blanket, and latex gloves. One recommendation was for a survival kit that would fit in an Altoids box. And that's a good idea if you travel in the backcountry. Even for a road cyclist, an emergency space blanket may be a lifesaver. Latex or nitrile gloves could be used for keeping your hands clean while fixing a chain, or they could protect you from blood or other body fluids if you have to render first aid.
Over many years of practical experience, I’ve formulated Wagner's Inverse Law of Tools: The one tool you desperately need will most likely be left at home. The solution is to ride in a group. That way, someone else probably has it.
At Christmas, I received a hand-held Topolino Device, that highly coveted gadget that every cyclist wants. When fired, it emits the "fate-worse-than-death" ray and converts modern cars to purple 1955 Fiat Topolinos with 500cc engines. The drivers sport clown suits and big, red noses. At least I think it does, because the instructions are in Italian and I can only go by the pictures. Unfortunately, the batteries in mine are dead and they seem to be proprietary units. If anyone knows of a source, please let me know.
Having a tool in your fist is only the first step. Knowing how to use it properly is an altogether different one. Describing how to perform a repair is beyond my ability, in print anyway. Besides, there are some excellent repair resources available. Here are a few:
Park Tools has an excellent repair section that covers nearly everything a home mechanic needs to know:
Jim Langley was a professional mechanic who wrote a maintenance column for Bicycling magazine. See the links at the bottom of the page too!
Sutherland's manual is a standard reference book for shop repair.
Barnett's manual is the bible of bicycle mechanics. It covers almost everything anyone needs to know about bikes. The manual is pricey, but it’s also the most comprehensive one in existence:
Richard Ballantine’s “Richard's Bike Book” The first edition of this book came out in the 1970s and it was one of the first books I read about bike repair. If I recall right, there was a lovely photo of a Condor on the cover. I still want a Condor! Anyway, my copy is lost, but I suspect you can find one in a used bookstore. There’s an updated edition titled “Richard’s Ultimate Bicycle Book”.
Eugene Sloan 'Complete Book of Bicycling" was my introduction to the art and science of wheel building. My copy is hopelessly out of date, but there’s still plenty of good advice between its covers.