I have a Drupal 7 site with 40 content types. When Drupal 8 will be released, I would like to migrate these content types.
Would this be possible, or would I have to create this content types from scratch?
I guess the best place to search for upgrade process is UPGRADE.txt file. Here you can find the step-by-step approach to follow in upgrading the site from Drupal 6/7 to Drupal 8.
Drupal 8 core will include a robust data migration API: https://drupal.org/node/2121299, part of the IMP initiative: https://groups.drupal.org/imp . Also you can check the recently updated list of modules that are included in Drupal 8 core: http://blog.merge.nl/2014/01/21/drupal-which-drupal-7-modules-went-into-drupal-core
Few of the links that you check:
Why not give a try to automated service CMS2CMS? http://www.cms2cms.com/supported-cms/drupal/ Good solution - cheap and fast. Not sure whether it supports Drupal 8 yet, but you may check. it. Good luck!