What is the maximum query length that can be submitted?

The maximum length of a query is 1 billion characters.

It is important to note that is a technical limitation for the query to be
accepted. Other limitations may apply, depending on the query pattern. For
example, If the query is made up of millions of values for an IN clause

SELECT x FROM table1 WHERE col1 in ('xxx','yyy',....)), it could fail with
out of memory, run for a long time, return a result set that is too large to
be displayed in the UI, etc.