Both are incorrect without the comma.
Both are correct with the comma.
You can skip the що as it can be inferred from the context.
You must, however, always separate the clauses by placing commas between them.
What you are dealing here is called compound/complex sentences. (1)
Each clause must be separated with a punctuation mark; usually a comma
,, but some cases require m-dash
:, or semicolon
Phonetically, each punctuation mark corresponds to a small pause in speech.
From the formal standpoint, subordinate clauses are linked to a certain word — usually a verb or a noun — of the main clause. If you think this way, it would greatly simplify your study:
я думаю... (I think...)
що думаєш? (what [do you] think?)
що ти тут (that you are here)
Here, the subordinate clause is explanatory to the verb as it gives more details on what "I" think, and the best conjunction for that would be що (that).
Mind the comma!
The correct grammar for the example sentence is:
я думаю, що ти тут.
Unlike English, the Ukrainian language has (almost) free word order, so it becomes easy to fall into ambiguity. Therefore, you must always separate the two clauses. And I believe it's something common for Slavonic languages. There's even a known phenomenon of Eastern Europeans who (ab-)use commas when they write in English, e.g., "people (comma) who", "I know (comma) that".
A language learner may also be confused about where to put the comma, before or after the що.
Rule of thumb: the conjunction що is part of the subordinate clause, so the comma goes before it.
Let us go bananas and swap two clauses around. It would give us a bit awkward, but grammatically correct, sentence:
що ти думаєш? (what do you think?)
що ти тут, думаю. (that you [are] here, [I] think)
Note that in this sentence, the subordinate clause is verbless; the є ('to be') is omitted, so if you omit the comma, too, it would "glue" into a meaningless single clause "that you here think", where the only presenting verb "think"/1st person/singular is out-of-sync declension with the noun phrase "you"/2nd person/singular.
Is it safe to skip?
Basically, in Ukrainian, you could skip anything that could be inferred.
So yes, you can skip що: (3)
що ти тут
You could even skip the pronoun as it can be inferred from the declension of the verb in the main clause:
я думаю, що ти тут
Here's one more example:
Чи скоро він приїде? (Will he arrive soon? — literally, "Is it soon how he arrives?")
Думаю, скоро. ([I] think [that he will arrive] soon)
As you see, we safely skipped everything that can be inferred from the context.
Again, the comma is crucial here. Without the comma, думаю скоро would mean, 'I think quickly'.
(1) The difference between the two is that compound ones contain two or more equally-ranked, mutually independent clauses, while complex ones always have a main, independent one, and one or more dependent ones.
(2) A subordinate clause can stand in the middle of the main one. In this case, it must be wrapped in commas before and after:
Хлопець, з яким я вчився разом, став президентом — A boy (comma) who I studied with (comma) became a president
Note that here the main clause is хлопець став президентом (a boy became a president), the subordinate clause explains the noun and stands in the middle of the main one.
(3) Not every conjunction can be skipped, however. In fact, що/який/котрий (that, which) are the rare ones that can be safely implied.