Suppose that $|A^\times|$ divides $|A| -1$, where $A^\times = B$ is the group of units.
Since a finite ring has a unique factorization into local rings, we can write $A = \prod_{i=1}^m A_i$ with local rings $(A_i,\mathfrak{m}_i)$ and find for the unit group
$$A^\times = \prod_{i=1}^m \hspace{1pt} A_i^\times.$$
[This editor makes me crazy: Without puting this formular into a single line it produces rubbish, having it in a single line, either with single-dollar or double-dollar, it works !?]
Since $(\mathfrak{m}_i,+)$ is a subgroup of $(A_i,+)$, we know that $|\mathfrak{m}_i|$ divides $|A_i|$, say $|A_i| = k_i |\mathfrak{m}_i|$. Now $A_i^\times = A_i \setminus \mathfrak{m}_i$ implies $|A_i^\times| = (k_i-1)|\mathfrak{m}_i|$. Since $|A^\times|$ divides $|A| -1$ we conclude that $|\mathfrak{m}_i|$ divides $-1$, what is only possible for $\mathfrak{m}_i = 0$. Thus $A_i$ is a field and we have shown:
$A$ is a direct product of fields
Let $|A_i|=q_i$. Then the assumption above is equivalent to $$ \prod_{i=1}^m (q_i -1) \quad \text{divides} \quad \prod_{i=1}^m q_i -1. \quad\quad\quad (\ast)$$
As I learned from A Haynes in the following link - and was correctly suggested by the OP - $(\ast)$ is a generalization of the Lehmer totient problem and still unsolved.
A question on divisibility of a product of primes A question on divisibility of a product of primes
In case $m=2$ it's easy to see that the only possibilities for $A$ are
$$\mathbb{F}_2 \times \mathbb{F}_2, \quad\quad \mathbb{F}_3 \times \mathbb{F}_3$$
Moreover, as pointed out by François in his comment, $A= \mathbb{F}_2^m$ satisfies the assumption for every $m$.