How do I prevent from cramping after a long run?

Some simple steps. The best way to avoid cramping is to maintain proper hydration during the run. Runs of less than 60 mins, use water. Greater than 60 mins, consider electrolyte fluids (eg gatorade) and running gels. After the run, continue appropriate hyrdation, stretch, slowly cool down, and massage your trouble spots. I hope that helps.
Cramping. Make sure that you spend time stretching after a long run and hydrate; consider electrolyte replenishment and take some time before sitting down so the muscles do not cramp up.