Why do I have 2 IPv6 addresses? If I go to System Preferences &gt; Network &gt; Advanced it is shown that I have 2 different IPv6 addresses (both with a 64-bit prefix). Why is so? 

If I type ifconfig | grep inet on the terminal, it also shows me those 2 IPv6 addresses (among the other addresses). At the end of one of those 2 IPv6 addresses there's the word dynamic and at the end of the other there's autoconf temporary. Why wonder why should we need two IPv6 addresses and what is the different between dynamic and autoconf temporary.
IPv6 used to be derived of the MAC address of your device. This is the Modified EUI-64 format. Such addresses are recognisable by looking at the middle of the last 64 bits. If they contain ..ff:fe.. then it is probably a EUI-64 based address.

Because the algorithm produces the same 64 bits every time some people were afraid that it would become easy to track mobile devices such as laptops and smart phones. Every network would have a different prefix, but the last 64 bits would always be the same.

That is why Privacy Extensions were invented. A device generates new 64 bits every once in a while and uses that in the IPv6 address. Because new addresses are generated regularly the addresses are marked as temporary. A device can have multiple privacy extension addresses if the system is still using an old address when a new address is being generated. The system will keep the old address for as long as necessary. For new outgoing connections a system will usually use the most recently generated temporary address to maintain a maximum level of privacy.