TVS diode before or behind resistor
You have three components there that are all there for protecting the AVR, but all are doing a different job.

The resistor is there to stop steady state high voltages.

The capacitor is to remove ripple/RF/slow transients.

The TVS is to suppress fast transients.

In order to get the best out of your protection, you need to have the shortest (lowest inductance) path back for the fast transient impulses (such as ESD). To do this, you fit the TVS (the fastest responding device) as close to the input to the board as possible. The capacitor would then be a bit further in (depending on the layout and design) and the resistor (which only deals with very slow, or steady state situations) can pretty much be on the pin of the AVR

EDIT: As some of the other answeres have added, you can use diodes (mainly Zener diodes) to clamp the voltage of the signal rail. The important difference between Zener diodes and TVS diodes is the speed of reaction and power dissipation: a Zener will clamp the voltage at steady states, but will not catch the quick spikes from ESD or similar events. A TVS will react quickly and catch the spike, but is not designed to handle a continued over voltage event.