Let $(X,\mathcal{M},\mu)$ be measure space and $f:X\to[0,\infty]$ a function such that $\displaystyle\mu(A)=\sum_{x\in A}f(x)$ for any $A\in\mathcal{M}$.
Suppose $\mu(A)=\infty$.
If every $B\in\mathcal{M}$ with $B\subseteq A$ has either measure $0$ or infinite measure, then, by definition, $A$ is atomic.
Otherwise take $B\in\mathcal{M}$ with $B\subseteq A$ and $0<\mu(B)<\infty$. It will follow from the finite measure case that $B$ contains an atom. Since $B\subseteq A$ , $A$ contains an atom.
Now suppose $0<\mu(A)<\infty$.
For $M\in\mathcal{M}$ consider the notation $M^+:=\{x\in M:f(x)>0\}$. Notice that if $B\subseteq A$ and $\mu(B)<\mu(A)$, then $B^+\subsetneq A^+$. (otherwise we would have the same finite sums and therefore the same supremum of finite sums.)
Since $\mu(A)<\infty$, the set $A^+$ is countable$^{(*)}$. Let $\{x_0,x_1,x_2,...\}$ be an enumeration of that set.
For each $n\in\mathbb{N}$ let $S_n\in\mathcal{M}$ be a set that separates $x_0$ and $x_n$, more precisely, a set such that $x_n\in S_n$ and $x_0\notin S_n$. If there is no such set define $S_n=\emptyset$.
Define $\displaystyle S=\bigcup_{n\in\mathbb{N}}S_n$. If $x_n\notin S$ then no measurable set separates $x_0$ and $x_n$, otherwise we would have $x_n\in S_n\subseteq S$, and clearly $x_0\notin S$.
The set $A\setminus S$ is atomic:
Since $x_0\in A\setminus S$, we have $\mu(A\setminus S)\geq f(x_0)>0$, so $A\setminus S$ has positive measure.
Now suppose, for contradiction, that there is a set $B\in\mathcal{M}$ such that $B\subseteq A\setminus S$ and $0<\mu(B)<\mu(A\setminus S)$.
Since $\emptyset\subseteq B\subseteq A\setminus S$ and $0<\mu(B)<\mu(A\setminus S)$ we have $\emptyset\subsetneq B^+\subsetneq (A\setminus S)^+=(A^+\setminus S)$. But then $B^+$ separates $x_0$ from the elements of $(A^+\setminus S)\setminus B^+$, which is a contradiction.
$(*)$ If $A^+$ is uncountable, then $\mu(A)=\infty$:
Define $E_k:=\left\{x\in A:f(x)>\frac{1}{k}\right\}$. We can write $\displaystyle A^+=\bigcup_{k\in\mathbb{N}}E_k$. Since $A^+$ is uncountable, some $E_k$ is uncountable, in particular, some $E_k$ is infinite.
Since there are infinitely many $x\in A$ with $f(x)>\dfrac{1}{k}$, it follows that $\mu(A)=\infty$.
If we instead considered a set to be atomic if
$$ B\subseteq A~,~B\in\mathcal{M} \implies \mu(B)=0\text{ or }\mu(A\setminus B)=0 $$
then the $\mu(A)=\infty$ case no longer works. But adding the assumption that $\mu$ is $\sigma$-finite we can still take a subset of $A$ with finite measure.
And if $X$ is countable, then $A^+$ is always countable regardless of measure, and the second case applies directly.
With this definition the result is false in general. A counterexample is the $\sigma$-algebra given in this answer by taking $f\equiv 1$.