Univerbation of quam (“how, as”) + *dō (“then, until”), the second part being from Proto-Indo-European *doh₁, instrumental of *de.
Practice speaking and memorizing "quando" and many other words and sentences in Latin.