The key to long-distance riding is preparation. You will need:
* A repair kit, at least one spare inner tube, a pump, tire levers, allen wrenches, a spoke wrench, a cellphone or coins, and money to take the train if all else fails. Riding long distances means that it is impractical to walk home.
* Plenty of food and water. Don't under-estimate this. You need to eat and drink all the time, before you feel hungry or thirsty. If you don't your thighs will feel like they are on fire and in the worst case you may get tunnel vision and collapse. People normally never reach the point of running out of fuel in their daily life but it's a real danger on long bicycle rides. I will fall apart after about 80 km without food, so I eat and drink at least every 20 or 30 km. Don't start in the morning without breakfast either.
I take plain water (anything else gunks up the bottles) in one or two large (0.75 l) clear-plastic bottles, Power Bars or similar energy food, plus some whole-grain sandwiches. Do not take chocolate or other sugar-based food. On seriously long rides also take some salted nuts because sweating depletes minerals. Plus, of course, the staple of bicycle riding - bananas.
* Maps, of course. If you ride in a group you may get separated, or you might take a wrong turn and lose your bearings. The best scale is between 1:100,000 and 1:250,000. A compass is necessary in foreign countries. I now always carry a GPS receiver too, and skip the maps if I have the right one loaded into the unit. Of course I carry spare batteries.
* Clothing. If there is a chance of rain or cold weather, wear neoprene boots (imho, Adidas are best). They don't hurt if you don't need them but they'll keep you warm and dry. Since you don't normally move your toes while riding, cold feet are much more of a problem when riding than when walking. Also bring a raincoat and wear layers of clothing that let you adjust to the weather (Odlo shirts, for example, are very thin and lightweight but warm if worn underneath). Multiple or thick wool socks have never worked for me, they just make the shoes fit poorly.
Another key to long-distance riding is to deliberately ride slowly. It's enough to ride two or three km/h slower than you would ride normally. This takes constant conscious checking because your legs will want to go back to your "regular" speed. It's surprising that such a small speed reduction makes such a big difference, but 3 km/h less than normal extends your range enormously while 3 km/h more than normal will render you comatose
See also an article on "riding in a group"