What is the difference between TIMESTAMP and DATETIME types ?

All differences are written according to MySQL 5.7.

The most important difference between DATETIME and TIMESTAMP types is the timezone storage. TIMESTAMP stores the values converted from current time zone to UTC time zone while DATETIME ignores that. When you demand one date stored as TIMESTAMP, it's always returned in format of current time zone. But be carefull. If you change the MySQL server's time zone meantime, returned value won't be the same as it was saved.

Another difference is the range, bigger for DATETIME (from 1000 to 9999 years). TIMESTAMP supports only the range of 1970-2038.

Until MySQL 5.6.5, they're another difference. TIMESTAMP's default values could support current time value. In the other side, DATETIME didn't support this feature. According to MySQL documentation, this difference was erased in version 5.6.5.