The proper name of the country may be United States of America, but one says and writes that one is a resident of the United States of America. This is true with all place names that include a descriptor that is used in other instances ("republic", "states", "union" etc). The British Empire vs Britian, for example.
So, in all the instances you have cited above, you use the article when you refer to the place in running text; when you fill out a form asking for "Country" you would only write the proper official name (usually without the article).
Interested in Language