This question concerns more Mathematics than Physics, so it should be handled rigorously in order to avoid to generate even more confusion (I personally find quite confused this page Complete Set of Commuting Observables since it deals with the finite-dimensional case in the proofs and supposes that the statements are valid for the infinite-dimensional case, where instead things are much more subtle).
First of all compatibility of two observables represented by a pair of (generally unbounded) self-adjoint (not just Hermitian or symmetric) operators $A: D(A) \to H$ and $B:D(B) \to H$ in a (generally infinite-dimensional) Hilbert space $H$ means that their projection-valued measures commute.
In other words, if we focus on the spectral decompositions of the operators
$$A = \int_{\sigma(A)} \lambda dP(\lambda)$$ and $$B = \int_{\sigma(B)} \lambda dQ(\lambda)$$ it must be $$P_EQ_F=Q_FP_E\quad \mbox{for all Borel measurable sets $E,F \subset \mathbb{R}$.
}$$
Compatibility is the mathematical statement equivalent to the physical statement that the observables can be simultaneously measured.
If at least one, say $A$, of $A$ and $B$ is bounded (so that its domain coincide to the whole Hilbert space), compatibility is equivalent to commutativity
$$AB\psi = BA\psi \quad \mbox{for every $\psi \in D(B)$.}$$
When both $A$ and $B$ are unbounded (which physically means that the outcomes of their measurements can be arbitrarily large) commutativity on every common invariant domain is not equivalent to compatibility. There are famous counterexamples due to Nelson.
Finally, compatibility is by no means transitive, and this is one of the most interesting features of quantum theory. It gives rise to several no-go theorems regarding possible classical interpretations in terms of hidden variables (think of Kochen-Specker theorem for instance).