In C++, the term identifier is just a sequence of digits, letters and _, not starting with a digit. Such an identifier can appear anywhere, and doesn't have to identify anything, despite its name (no pun intended).
The term name associates a meaning with a certain grammar construct. The C++ spec says that one of the following grammar constructs is a name if it denotes an entity (an object, a class, a template and so on) or a label (where you can jump to with goto)
- identifier
- template-id (
identifier <...>, operator-function-id <...> and literal-operator-id <...>, as in foo <int>).
- conversion-function-id (
operator type, as in operator int)
- operator-function-id (
operator @, as in operator +)
- literal-operator-id (
operator "" identifier, as in operator "" _foo)
For each of these constructs, the rule when a name is the same as another name is defined differently: For identifiers, two names are the same of the sequence is the same (this is only a lexical comparison). For names of form conversion-function-id they are the same if the type used is the same type (so this is a semantic comparison).
As you can see in the example of literal-operator-id, the non-terminal identifier can appear in the grammar in places where it is not a name. So not every identifier is a name, and not every name is an identifier. In the example of template-id, we have a nested use of names. The constructs before the <...> respectively are names again, as they denote declared templates.