If $X$ has torsion in its cohomology, there’s nothing you can say. If $X$ is simply-connected with torsion free (co)homology then it has a homology decomposition, showing that its cone length, hence category, is at most the number of dimensions with nonzero (co)homology. Thus we can say
$$
\mathrm{cat}(X) \leq   \dim ( H^*(X;\mathbb{Q}).
$$
More can be said with information about the distribution of the nonzero groups (if there's clumping).