What determines sizeof(int)
int is a C type. The ATMega's have no concept of it, they work only with 8bit bytes (because they have 8bit AVR CPUs).

The compiler converts any operations on int types to the equivalent operations required to perform that operation at size level required by the CPU architecture - for an AVR, it is converted to do operations at the byte level, for a 16bit CPU, it would be done at the 16bit level, etc.

In avr-gcc an int type is simply defined in the compiler as a 2 byte integer. The fact that it changes based on platform means you are better off using the &lt;stdint.h&gt; types such as uint16_t if you want to be sure of the size in code which needs to be portable. There are types defined for all standard integer sizes (8,16,32,64) in both signed and unsigned. 

There are other definitions for so called _fast types which are guaranteed to be at least the required size, but will produce the fastest code based on the platform, for example 32bit processors tend to perform operations on 32bit numbers more efficiently than say 8bit numbers, so uint_fast8_t on a 32bit platform would be a 32bit integer (it's at least 8 bits, but is faster to handle).

The sizeof() instruction is performed at compile time, and converted to a constant, it is not executed by the processor. avr-gcc knows how big it has defined an int as, so it knows what constant to replace the sizeof() call with.