Article in “having (a) hard time”
It's odd that Google returns equally frequent hits. This is a common English colloquialism in its complete form (a hard time) but hearing/reading it without the indefinite article makes it sound distinctly broken to my English ears - as though someone with a Slavic tongue has characteristically dropped it.
It's possible that those who have not been familiar with the phrase since early childhood would assume that the article is unnecessary, since the "time" to which it refers is ongoing and without specific limits. However, the pattern is the same as it would be with any other adjectival modifier e.g. "having a good time," "having an interesting time" or even "having a quick nap."
In fact, the adjective-noun pair "Hard Time" (without article) is a different concept in English - another colloquialism for an extended and unpleasant period of imprisonment for crimes committed. Therefore hard, more than most adjectives in this circumstance, needs to retain the indefinite article.
I am a native of the US and have lived in several regions. In daily US English, the correct phrasing is "having a hard time." When I hear someone say "having hard time," I take it as a dead giveaway that the person is not comfortable in US English. There is a similar phrase "sentenced to hard time" (without the "a" preposition) which means that a criminal has been confined to a prison where manual labor is obligatory.