A weak cancellation property for monoids
An example. Consider the set $\{n\mid n\gt 0\}\cup \{u_n \mid n\gt 0\}\cup\{0\}$ with operation + which is the usual + on natural numbers, $n+u_k=u_k+n=(n+k), u_k+u_n=u_{k+n}$, $0+x=x+0=x$ for every $x$. It is a commutative non-cancelative monoid satisfying your condition. I do not think this class of monoids has a name.
There are books on commutative semigroups (Redei, Grillet,...).