I suspect that Thanos didn’t know the Tesseract was on earth.
Loki presumably made a deal with Thanos — give me the Mind Stone, and promise me an army; then I’ll go get the Tesseract for you, and use it to get the army to the planet so I can overthrow it.
If Loki tells Thanos which planet the stone is on, maybe Thanos just goes to get it for himself, and Loki gets nothing. Waiting for a portal to open is also a handy way to ensure Loki actually has the Tesseract before committing the army.
Even if Loki did reveal the Space Stone’s location, Thanos might have been being a bit more cautious at that point. He only had the Mind Stone, and aside from the mind control stuff we see in Avengers, it’s not clear what powers it has on its own. Thanos probably doesn’t know much about earth or its potential defenders — or he might be well aware that a certain aggressive and powerful Asgardian prince considers it as being under his protection.
He may not want to move his forces there and risk either immediate defeat, or more attention on him before he has more Infinity Stones to defend himself with. In Infinity War, he seems to collect the last five stones within a single day, having first got the Power Stone (which really does seem to make its bearer stronger and less vulnerable than almost any being we’ve seen) from Xandar the previous week.