When referring to America, one should use the definite article, "the", "the United States".
However, in some titles of posts, the definite article is omitted.
Is that some kind of grammar rule?
You're right. In general, we should absolutely use 'the' to say 'The United States of America'.
The examples you show use 'headline style grammar'. I would say this is more of a style than a rule. Since headlines need to be short, some ellipsis (omission of words) is used.
This ellipsis is often applied to:
So, the phrase:
The United States Presidential Election was held recently
could be transformed into 'headline style' like so:
United States Presidential Election held recently
More formally, this style is referred to as Headlinese. You can read more about it (there is more to it than just ellipsis) here.