In The Galois/Counter Mode of Operation (GCM) by McGrew and Vega (PDF) it's stated that:
An initialization vector IV , that can have any number of bits between $1$ and $2^{64}$. For a fixed value of the key, each IV value must be distinct, but need not have equal lengths. 96-bit IV values can be processed mor e efficiently, so that length is recommended for situations in which efficiency is critical.
But how to choose the IV's size and how - if so - it affects the security of the algorithm?