How is the number of amplitude levels decided in modulation techniques? For M-QAM modulation, where e.g. $M = 64$ there are 8 amplitude levels. Each level is represented by a symbol that is further represented by bits through the relation: 
$$b=\log_2(M)$$ 
This means that each symbol is encoded by $b$ bits. 


I don't quite understand where 64 comes. Does it mean that the imaginary and real component are included ($8\cdot 8$) ? 
For other modulation methods such as 16-QAM, where is the 16 coming from?
There are $M$ symbols in an $M$-QAM constellation where two carriers I and Q are amplitude modulated, and there are $N=\sqrt M$ amplitudes for each I and Q carriers (for $M\ge4$). In $16$-QAM there are 16 symbols on a $4\times4$ constellation. That is, there are $4$ amplitude levels for the I and $4$ levels for the Q component. Of course, $\log_2M$ bits are conveyed by each symbol. Since $M$-QAM normally uses carriers with symmetric amplitudes, $M$ is usually a power of $4$. For instance, $M$ can be $4, 16, 64, 256,\cdots$.