Principal ideal domain
Finitely-generated modules over principal ideal domains (PIDs) are classified by the structure theorem for finitely generated modules over a principal ideal domain: the primary decomposition is a decomposition into indecomposable modules, so every finitely-generated module over a PID is completely decomposable.
Explicitly, the modules of the form R/pn for prime ideals p (including p = 0, which yields R) are indecomposable. Every finitely-generated R-module is a direct sum of these. Note that this is simple if and only if n = 1 (or p = 0); for example, the cyclic group of order 4, Z/4, is indecomposable but not simple – it has the subgroup 2Z/4 of order 2, but this does not have a complement.
Over the integers Z, modules are abelian groups. A finitely-generated abelian group is indecomposable if and only if it is isomorphic to Z or to a factor group of the form Z/pnZ for some prime number p and some positive integer n. Every finitely-generated abelian group is a direct sum of (finitely many) indecomposable abelian groups.
There are, however, other indecomposable abelian groups which are not finitely generated; examples are the rational numbers Q and the Prüfer p-groups Z(p∞) for any prime number p.
For a fixed positive integer n, consider the ring R of n-by-n matrices with entries from the real numbers (or from any other field K). Then Kn is a left R-module (the scalar multiplication is matrix multiplication). This is up to isomorphism the only indecomposable module over R. Every left R-module is a direct sum of (finitely or infinitely many) copies of this module Kn.