A good review of the history of the subject is Ch. 2 of Ernst's Comprehensive Treatment of q-Calculus, which names Bernoulli's numbers as an early appearance, and characterizes the work on elliptic and theta functions since 1750-s as "pre-$q$ mathematics".
Presumably, $q$ stands for "quotient" or rather its Latin counterpart "quotus", it traditionally appears in the geometric series notation. Euler in 1738 studied generating functions of the Bernoulli polynomials, and already introduced the $q$-series (a.k.a the Euler function) in the oft-cited chapter 16 of Introductio in Analysin Infinitorum (1740) called De Partitio Numerorum. Euler's work on partitions was prompted by questions about them raised to him by a French mathematician Naude, see Debnath's Brief History of Partitions of Numbers. Jacobi continued to use the letter in his work on theta functions.
Ernst divides the $q$-tradition into two major "schools", Watson's and Austrian, and makes interesting remarks about its notational history:
"The various Schools of $q$ to be outlined below have developed over a period of roughly 300 years since the Bernoullis and Euler. These Schools today use and communicate in such different languages, that they have problems understanding each other. The big School of Watson speaks—both literally and metaphorically—
English. It has little exact consciousness of, indeed may not find it necessary, to study and know the roots of the vernacular... And we have in the q-area, in relation to other areas, a tendency to develop specific, new languages (e.g. notations), which surpasses this tendency in other fields of mathematics. This is either because practitioners find these more easy to speak, because they find them more beautiful or simply because they do not know and cannot pronounce the older forms.
[...] Both Schools or traditions recognize the early legacies of Gauß and Euler. Only the Austrian School, however, represents and incorporates the entire historical background which includes the pre-$q$ mathematics, namely the Bernoulli and Euler numbers, the theta functions and the elliptic functions. The vast area of theta functions and elliptic functions... is in fact $q$-analysis before $q$ was really introduced.
[...] The Austrian School is little known in the English speaking world, e.g. the USA and the Commonwealth, for two main reasons: Immediately after the first world war, ca. 1920 until 1925, the German and Austrian mathematicians were barred from participation in the big mathematical conferences... The second and more important reason has to do with languages. Most of the mathematicians of the Austrian School wrote in either German or French and, as regards the oldest,
namely Euler, Gauß and Jacobi, in Latin. Only few English-speaking mathematicians today master these languages... The Watson School is today the most widespread and influential of the two principal Schools/traditions. But again this is mainly due to the language."