Easy - Note the move that determines the opening name. If it's a move by Black, it's a Defense. If it's a move by White, it's an Attack, Opening, or System.
In either case, if it's a Gambit, it's called just that rather than a Defense, like the Latvian "Gambit".
1.e4 e5 openings are a bit of an exception because of how old they are. Many of them weren't identified as Openings or Defenses at the time. They were just "The Spanish" (now also known as the Ruy Lopez), or "The Russian Game" (now also known as Petroff's Defense), etc.
If you exclude 1.e4 e5, note the following:
1.e4 doesn't define a French. After 1.e4, 1...e6 does define the French. Since Black made the defining move, it's named the French "Defense".
1.c4 defines the English. Can it transpose to something else? Yes! However, provided it doesn't, it's known as the English "Opening".
1.d4 doesn't define the Torre. 1...Nf6 doesn't define it. 2.Nf3 still doesn't define an opening. 2...e6 (or 2...g6) doesn't either. 3.Bg5 now the system has a name. It's the Torre. Who made the last move? White! Therefore, it's the Torre "Attack" and not the Torre "Defense".
The term "Variation" is specifically a subset of an Opening or Defense. Take your example. 1.e4 e6 2.d4 d5 3.Nd2 is the Tarrasch "Variation", but it's still a French "Defense" as well. It's the Tarrasch "Variation" of the French "Defense".
For something to be named a "Variation", the following would have to make sense (filling in the blanks):
The ___________ "Variation" of the ____________ "Opening/Defense/System/Game/Attack".
The first blank is the "Variation", the second is the "Opening Name" (or Defense, System, etc.)
Is there a guideline for naming opening variations, and if so, what is it?
For example, it sounds like the first few moves of an opening can be named "Opening", or if it's White's move it can be called an "Attack", or if it's Black's move it can be called a "Defense". If I'm not mistaken, a particular attack after that name can be called an "Attack", also. Somewhere in there an opening can also be called a "Game". Somewhere after that a line can be called a "Variation". I also read that after the 1972 Fischer-Spassky match that one of Fischer's lines would be properly called a "Continuation" (specifically "The Fischer Continuation") instead of "Variation", but that's the only time I ever heard of the word "Continuation" being used formally in a name.
Specific examples:
1. Nf3 - Zukertort Opening
1. c4 - English Opening
1. b3 - Nimzo-Larsen Attack
1. Na3 - Sodium Attack
1. e4 c5 - Sicilian Defence
1. e4 e6 - French Defence
1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 - Four Knights' Game
1. e4 e5 2. Nf3 Nc6 3. Bc4 - Italian Game
1. e4 e6 2. d4 d5 3. Nd2 - Tarrasch's Variation (of French Defense)
1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 4. Bb5 Nd4 - Rubinstein Variation (of Four Knights' Game)