Variables for template files are set in their preprocessor functions, for example the node template has template_preproess_node(&$variables).
Any module or theme can hook into these preprocessor functions to set/modify/remove variables, which will then be available in the template file.
For example if in the preprocessor you set:
$variables['my_new_variable'] = 'This is some text in a new variable';
You can then use $my_new_variable in the template file.
Now after all the preprocess functions are called, then there are process functions, which for the node template would be template_process_node(&$variables).
So most of the time variables are added in preprocessors, so to see all the variables you should check in the processor.
So in your theme's template.php file add:
/**
* Variable processor for the node template.
*/
function THEMENAME_process_node(&$variables) {
// Print the variables to the screen.
print_r($variables);
// A better alternative is to install the devel module and then do this.
dpm($variables);
}
In the above example change THEMENAME to the name of your theme.
As noted in the above example, you get a much better result if you install the devel module and use the dpm() function, instead of print_r().
Note that when you use dpm() in templates & preprocessors it takes 2 page refreshed to see you message instead of 1.
You will also usually get a satisfactory result by doing this in the equivalent preprocess function instead of the process function.
Now there is still a (negligible) chance that after your process function is run, that another implementation of the process function.
If you really need to (you most likely don't), update the weight of your theme in the settings table of the database and make it a very high number, so it runs last.
Note: This is more advanced and if you are unsure of what I'm talking about you are probably best not to mess with this. It likely isn't necessary anyway.