I'm wondering if the compact objects in $\textbf{Scheme}/X$ (schemes over $X$) are the quasi-compact morphisms with codomain $X$. By "compact object" I mean that the covariant representative functor $\textbf{Scheme}(X, -)$ commutes with filtered colimits.
If the compact objects aren't quasi-compact, what are they? Or, under what conditions does this statement hold?
It's definitely not true that quasicompact morphisms are compact objects in general. In fact, I suspect that the only compact object over any base $X$ is the empty scheme, and I can prove this in the case when $X$ is Spec of a field. Let's start with a lemma.
Using this lemma, you can then find lots of examples of affine schemes that are not compact objects in the category of schemes. Indeed, if $C$ is any ring with a homomorphism $A\to C$ which does not factor through $A_i$ for any $i$, then $\operatorname{Spec} C$ cannot be compact (it has a map to $\operatorname{Spec}A$ which does not factor through any $\operatorname{Spec} A_i$). For an explicit example, you could let $k$ be a field and $A_n=k[x]/(x^n)$, so $A=k[[x]]$. Then we conclude that for any ring $C$ with an injective homomorphism $k[[x]]\to C$, $\operatorname{Spec} C$ is not compact.
In particular, let's now consider schemes over a field $k$. Let $Z$ be any nonempty scheme over $X=\operatorname{Spec} k$, and let $T$ be a set of cardinality greater than that of the residue field of some point $p\in Z$. For each cofinite subset $I\subseteq T$, consider the field $k(I)$ of rational functions over $k$ with a variable for each element of $I$. These fields form an inverse system of subfields of $k(T)$, and their inverse limit (i.e., intersection) is just $k$. Thus by the Lemma, the schemes $\operatorname{Spec} k(I)$ form a directed system with colimit $X$. Now $Z$ has a morphism to $X$, but it does not have a morphism to $\operatorname{Spec} k(I)$ for any $I$, since the residue field of $Z$ at the point $p$ has cardinality smaller than that of $k(I)$. Thus $Z$ is not compact in the category of schemes over $X$.