To expand on Seth's answer. In the case where the index set $I$ has finite cardinality $\bigoplus_{i\in I} M_i$ is the same as $\prod_{i\in I} M_i$. The cases where they differ are when you are forming a direct sum and direct product over an infinite index set.
In such cases $\bigoplus_{i\in I} M_i=\{(m_i)_{i\in I}\vert m_i\in M_i, m_i=0_{M_i}$ for all but finitely many $i\in I\}$. Another way of saying this is that an element in the direct sum is almost trivial.
On the other hand $\prod_{i\in I} M_i=\{(m_i)_{i\in I}\vert m_i\in M_i\}$. Notice the direct product lacks that restriction on its elements the direct sum has. Also, you should be able to see from these expressions why the direct sum and the direct product will coincide in the finite index case.