To sum up: when $X$ and $Y$ are affine over a common base $k$, then $X \times_k Y$ is also affine over $k$, hence quasicompact; however, even if $X$ and $Y$ have finitely many connected components, $X \times_k Y$ may not.
For example, consider the case $X = Y = \operatorname{Spec} \overline{\mathbb{Q}}$, $k = \mathbb{Q}$.
Then $X$ and $Y$ are just points, and $X \times_k Y = \operatorname{Spec} {\overline{\mathbb{Q}} \otimes_\mathbb{Q} \overline{\mathbb{Q}}}$, of course, but $\overline{\mathbb{Q}} \otimes_\mathbb{Q} \overline{\mathbb{Q}}$ is an extremely complicated ring: ring homomorphisms $\overline{\mathbb{Q}} \otimes_\mathbb{Q} \overline{\mathbb{Q}} \to \overline{\mathbb{Q}}$ correspond to pairs of automorphisms of $\overline{\mathbb{Q}}$, so (skipping lots of steps) we can identify prime ideals of $\overline{\mathbb{Q}} \otimes_\mathbb{Q} \overline{\mathbb{Q}}$ with elements of the absolute Galois group, and this identification extends to a homeomorphism of topological spaces.
But (the underlying space of) the absolute Galois group has infinitely many connected components.
It is tempting to say that a quasicompact scheme has finitely many connected components, but the (counter)example above is a compact Hausdorff space yet has (uncountably) infinitely many connected components.
(It is a profinite set.)
The reason for this failure of intuition is that connected components need not be open in a general topological space.
To avoid pathologies (or, to be more open minded, surprises) like this, you should assume $X$ and $Y$ are of finite type over $k$.
Then $X \times_k Y$ is also of finite type over $k$, and schemes of finite type over a field always have finitely many connected components.