Here's my advice (I am Italian). The level of formality is the following:
(less) macchina → auto → automobile (more)
There is a wider "gap" in formality between "macchina" and "auto" than "auto" and "automobile" which are almost at the same level.
As a rule of thumb I suggest you to prefer the two former words, especially when speaking or writing informal communication (SMS, email). The latter is preferred for formal speaking or in written form.
Of course you can also use "automobile" and nobody will react as if you said something strange, it is just less common (but completely acceptable).
Ok well, not to that extent. :D You will probably read or hear the Italian word "automobile" in advertisements as well, it is not so formal you would use it only for VIPs. :)
See for example this (old!) ad from the 80s that tells you to look for "Automobili" in the yellow pages: https://riflessionidalmondo.files.wordpress.com/2009/12/auto81-1.jpg
Technically, "macchina" is a machine. Any machine. But the two terms are interchangeable and, in fact, it seems that "macchina" is often the preferred noun for "car".
Probably because "automobile" has two extra syllables.
Which is why you also see "La Metro" instead of "La Metropolitana", or "una foto" instead of "una fotografia", and so on.