If you use the term "template" in the TYPO3 context this has many meanings. Because of this, i will use two different terms:
2. TypoScript Templates: The "gluecode" betwee the TYPO3 backend and the website is TypoScript. With the TYPO3 configuration TypoScript you tell TYPO3 how to render the content on the final website.
During the last year multiple approaches have been implemented into TYPO3 to implement a website template. It depends on your requirements and on your taste, which technology you should use.
For now i would shortly describe the different technologies and in the sub chapter we will have a deeper look on each of them.
Using marker and subparts is "the mother of templating" in TYPO3. The advantage is, that the usage and implementatoin is quite simple.
Advocates of this approach use as an argument, that with this approach no XML is stored in the database and relations are used in a correct way. A competeting technology is TemplaVoila, which is using this XML approach, that makes it very flexible but somehow also abuses the relational database.
Here you can learn how to use the marker and subpart technology
Another technology, that we also use on this site is TemplaVoilá. TemplaVoilá offers a flexible approach to implement complex layouts.
An own backend module helps to map you HTML files into the TYPO3 CMS