This is not true in general. For instance, suppose $R$ is a Boolean ring (a ring in which every element is idempotent; any such ring is automatically commutative). If $M$ is an $R$-module, then for any $r\in R$, $M=rM\oplus (1-r)M$. If $M$ is indecomposable, let $I$ be the annihilator of $M$; then for any $r\in R$, either $r\in I$ or $1-r\in I$. It follows that the quotient ring $R/I$ is isomorphic to $\mathbb{F}_2$. Since $M$ is an indecomposable $R/I$-module, we must have $M\cong R/I$, and $M$ is simple.
However, if $R$ is infinite, $R$ will not be semisimple. Indeed, by the argument above, every simple $R$-module has two elements, so every finitely generated semisimple $R$-module must be finite. A simple example of an infinite Boolean ring is a product $R=\mathbb{F}_2^I$ for any infinite set $I$ (in fact, every Boolean ring is a subring of such a product).
More generally, one has the following theorem:
Theorem: Let $R$ be a commutative ring. Then the following are equivalent:
Every indecomposable $R$-module is simple.
Every ideal in $R$ is generated by idempotents.
$R$ is reduced and every prime ideal in $R$ is maximal.
Here's a sketch of the proof. To prove ($2\Rightarrow 1$), use an argument similar to the argument given above in the case that $R$ is Boolean. To prove ($1\Rightarrow 3$), note that the localization of $R$ at any prime is indecomposable, so (1) implies the localization of $R$ at any prime is a field, which can easily be seen to imply (3). To prove ($3\Rightarrow 2$), show that if every prime in $R$ is maximal, then $X=\operatorname{Spec}(R)$ is Hausdorff. Every affine open subset of $X$ is compact, and thus closed in $X$ since $X$ is Hausdorff. One can then use the correspondence between clopen subsets of $X$ and idempotents in $R$ and the fact that $R$ is reduced to show that every principal ideal in $R$ is generated by an idempotent. It follows that every ideal is generated by idempotents.