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 it’s cone length, hence category, is at most the number of dimensions with nonzero (co)homology.