Answer
$A=\frac{Mg}{k}$.
Work Step by Step
If the penny to stay in contact with the block at all times, the normal force on the penny, $F_N$, is nonzero. The normal force on the penny is directed upward. Choosing upward to be the positive direction, Newton’s second law tells us that $F_N-mg = ma$, or $F_N=mg+ma$. When the block is accelerating upward, the acceleration a is positive, and the penny never loses contact with the block.
However, we see that a downward acceleration could cause the normal force to equal zero. The critical point occurs when the magnitude of the acceleration a is equal to g.
For SHM, we know the magnitude of the maximum acceleration. We also know that the penny's mass, m, is much, much less than the block's mass, M.
$$a_{max}=\omega^2 A=\frac{k}{M+m}A\approx\frac{k}{M}A$$
Equate the magnitude of the maximum acceleration to g, and solve.
$$ \frac{k}{M}A=g$$
$$ A=\frac{Mg}{k} $$