This is true even if we replace $x-c_i$ with an arbitrary irreducible factor, though in that case we must multiply $d_i$ by the degree of the factor. But I'll keep it to the linear case:
Let $K_{i} = \{v\in V\mid (T-c_iI)^m(v)=0\text{ for some }m\geq 0\}$. Then $W_i\subseteq K_i$.
In fact, $K_i=W_i$. The inclusion $W_i\subseteq K_i$ is immediate. For the converse, restrict $T$ to $K_i$. The only eigenvalue is $c_i$, so the characteristic polynomial of $T\bigm|_{K_i}$ is $(x-c_iI)^p$. But the characteristic polynomial of $T\bigm|_{K_i}$ divides the characteristic polynomial of $T$, so $p\leq d_i$. Since $f(T)$ is zero on $V$, it is zero on $K_i$, so the minimal polynomial of $T|_{K_i}$ divides both $(x-c_i)^{d_i}$ and $f(x)$. Therefore, the minimal polynomial of $T|_{K_i}$ is $(x-c_i)^{r_i}$, so $(T-c_iI)^{r_i}$ is identically zero on $K_i$. That is, $K_i\subseteq\mathrm{ker}(T-c_iI)^{r_i}=W_i \subseteq K_i$.
Thus, $K_i=W_i$. Note also that the $p$ in the above argument is the dimension of $K_i$, so $\dim(W_i) = \dim(K_i) = p \leq d_i$.
Lemma. If $c\neq c_i$, then $T-cI$ is one-to-one on $K_i$.
Proof. Let $x\in K_i$ be such that $(T-cI)x=0$; let $p$ be the smallest nonnegative integer such that $(T-c_iI)^p = 0$. If $p\gt 0$, let $y=(T-c_i)^{p-1}x$. Then $y\neq 0$, $(T-c_iI)y = 0$, so $y$ is an eigenvector of $c_i$. But $(T-cI)y =(T-cI)(T-c_iI)^{p-1}x = (T-c_iI)^{p-1}(T-cI)x = (T-c_iI)^{p-1}0 = 0$, so $y$ is also an eigenvector of $c\neq c_i$, which is impossible. So $p=0$, hence $x=0$. Thus, $T-cI$ is one-to-one on $K_i$. $\Box$
Note also that $\dim(K_i) =
That means that $K_i\bigcap \sum_{j\neq i}K_j = \{0\}.$ (If something is in the intersection, then it lies in some $K_j$ with $j\neq i$; since $T-c_iI$ is one-to-one on every $K_j$, $j\neq i$, then $(T-c_iI)^mx=0$ implies $x=0).
Thus, \dim(W_1)+\cdots+\dim(W_k) \leq d_1+d_2+\cdots+d_k = \dim V$. So it suffices to show that $W_1+\cdots+W_k = V.
Induction on k$. If $k=1$, then the characteristic polynomial of $V$ is $(x-c_1)^d_1$, and by the Cayley-Hamilton Theorem we have $V=K_1=W_1, and we are done.
Assume the result holds for linear transformations with fewer than k\gt 1$ eigenvalues. Let $g(t) = (x-c_1)^{d_1}\cdots(x-c_{k-1})^{d_{k-1}}$. If $W=\mathrm{Range}(T-c_kI)^{d_k}.
Since T-c_kI$ maps $K_i$ into itself if $i\neq k$, is one-to-one, and so onto. So $K_i\subseteq W$ for all $i\neq k$. So $c_i$ is an eigenvalue of $T|_W$ for all $i\lt k$. On the other hand, $c_k$ is not an eigenvalue of $T|_W$, because $g(T)$ is the zero linear transformation on $W$ by the Cayley-Hamilton Theorem; so the minimal polynomial of $T|_W$ divides $g(t)$, and so the only possible eigenvalues are $c_1,\ldots,c_{k-1}.
So T|_W$ has fewer than $k$ eigenvalues. By induction, we have $W=K_1+\cdots+K_{k-1}$. On the other hand, $\mathrm{ker}(T-c_kI)^{d_k}\cap W=\{0\}$, so by the Rank-Nullity Theorem we have that $V=\mathrm{Range}(T-c_kI)^{d_k}+\mathrm{ker}(T-c_kI)^{d_k} = K_1+\cdots+K_{k-1} + K_k.$
Therefore, $n = r_1+\cdots+r_k \geq \dim(K_1)+\cdots+\dim(K_n)\geq \dim(K_1+\cdots+K_n) = \dim(V) = n,$ so we have equality throughout. In particular, $\dim(K_i)=r_i$.