Microcontroller Protection
This is a very broad questions, but here are some thoughts:


Don't ever route a microcontroller pin out of your box.  Anything outside of your enclosure is susceptible to human- and machine-induced ESD, voltage surges, induced EMI which can become very strong over long distances (enough to interfere with, reset, or destroy your sensitive micro).  Always use some type of buffer or isolation.  I would even be nervous about routing my micro's power supply rails outside the box - anything can happen out there, especially if we are literally talking about cable runs outdoors.
For board-to-board connections within your chassis, it is often sufficient to employ a diode clamp (a reverse biased diode to each of your rails) or a zener clamp (reverse biased zener diode), to discharge any induced currents to your supply rather than small or non-existent clamping in the micro's pin.  There are also specialized devices that manufacturers tout for this purpose, but I don't think they offer much advantage over a simple diode clamp unless it is high-speed USB or something.
If you need to go outside of your chasis (e.g. USB, RS232/485 or other communication lines, use a buffer or other dedicated IC for clamping and/or buffering because these are generally beefed up for this purpose.  If is just a simple digital sense line, you can often design your circuit around a generous resistance on both sides of the external sense element, softening the effect of any EMI that comes in.
If you need to route a power supply outside of your box, make sure it is not directly connected to your internal power rails.  Eventually someone WILL short it out in field wiring (from my experience lots of people will).  You should at very least use a fuse and some EMI filtering (X-caps, Y-caps to earth ground and a common-mode choke).  On one product we had to source 12VDC power from the device and we found the best option was to include an isolated DC to DC converter with automatic over-current shutdown and reset.  It meant that when the short was removed, the device would resume operating unharmed.


There are many more things one could suggest, and all of these add cost and complexity, but one lesson you can learn the hard way or the easy way is:
Ruggedness Never Comes Cheap