Generic programming
Template metaprogramming is a programming style which (in the words of Andrei Alexandrescu) "focuses on abstracting types to a narrow collection of functional requirements and on implementing algorithms in terms of these requirements". As a programming style, template metaprogramming is technically applicable to many programming languages, but normally the term is used for programming using the "template" construct of C++. C++ popularized the notion of templates, but it was not the first language to support them (C++ templates were partially based on Ada) nor the last (i.e. Java doesn't have templates yet but the work to add them is ongoing).
The standard example for the desirability of templates is the problem of implementing a type-safe data container, like a stack or a dictionary. The semantics of stack (whatever goes last in goes first out) is defined irrespective of the type of its elements, but the application programmer would normally like to restrict what goes in a particular stack (just as they restrict what can be assigned to a particular variable). That makes a generic implementation (by the library programmer, who cannot know all the applications built on top of their library) problematic. But the unwanted dependency from library to application can be broken by abstracting the type of the stack's elements. The library programmer can then write a stack template, which is instantiated by the application programmer for the type they want to use. The concrete implementation of this concept (not just for stacks and dictionaries, but for many other containers, and also for algorithms operating on (abstractions of) those containers) is called STL and is part of the standard C++ library.