$M$ is a graph manifold if and only if $\phi$ is not pseudo-Anosov and, in the reducible case, no $\phi$-orbit of components of the complete reduction of $\phi$ is pseudo-Anosov.
To prove this cut $M$ along the torus system $T$ obtained by suspending the canonical reducing system for $\phi$. If no component of the complete reduction of $\phi$ is pseudo-Anosov then each component of $M-T$ is Seifert fibered. If some $\phi$-orbit of components of the complete reduction is pseudo-Anosov then the corresponding component of $M-T$ is hyperbolic.