This is an exercise in Hungerford. But can somebody explain why is the following not a counter-example?
Let $G$ be the direct sum of $|\mathbb{R}|$ copies of $\mathbb{Q}$. Let $K$ be the direct sum of $|\mathbb{N}|$ copies of $\mathbb{Q}$. Then $G \oplus \mathbb{Q} \cong G \oplus K$ but $\mathbb{Q}$ is not isomorphic to $K$.
Indeed, suppose $f : \mathbb{Q} \rightarrow K$ is a $\mathbb{Z}$-module isomorphism. We may show that $f$ is a $\mathbb{Q}$-module isomorphism obtaining thus a contradiction. For any $v \in Q$ non-zero and a non-zero natural $b$ there is a unique $w$ such that $bw = v$, that is $w = (1/b)v$. We have $b[(1/b)v] = v$ so $b f((1/b) v) = f(v)$. The same uniqueness argument applies in $K$ since it is torsion-free, so $f((1/b) v) = (1/b) f(v)$. Hence $f$ is a $\mathbb{Q}$-module isomorphism.