  We study abelian varieties $A$ with multiplication by a totally indefinite
quaternion algebra over a totally real number field and give a criterion for
the existence of principal polarizations on them in pure arithmetic terms.
Moreover, we give an expression for the number $\pi_0(A)$ of isomorphism
classes of principal polarizations on $A$ in terms of relative class numbers of
CM fields by means of Eichler's theory of optimal embeddings. As a consequence,
we exhibit simple abelian varieties of any even dimension admitting arbitrarily
many non-isomorphic principal polarizations. On the other hand, we prove that
$\pi_0(A)$ is uniformly bounded for simple abelian varieties of odd square-free
dimension.
