Is there any difference between free variable and global variable? Or they are just synonyms? In which situations I should use one or another?
They don't play in the same category.
The notion of free variable is relative to a scope. If a variable is present in a term (i.e. a subprogram) and its scope is larger than this term, then the variable is said to be free in that term.
A global variable is one whose scope is the whole program, or the whole file, or the whole module, or whatever scope is called “global” in the programming language you're considering.
According to Wikipedia, Free variables and bound variables,
The term free variable refers to variables used in a function that are not local variables nor parameters of that function. The term non-local variable is often a synonym in this context.
Now Wikipedia, Non-local variable states:
In programming language theory, a non-local variable is a variable that is not defined in the local scope. While the term can refer to global variables, it is primarily used in the context of nested and anonymous functions where some variables can be neither in the local nor the global scope.
The last quote is from Wikipedia, Global variable:
In computer programming, a global variable is a variable that is accessible in every scope (unless shadowed).