I don't know what "unique under change of orthonormal basis" means but here is what we can say about uniqueness. If $T$ is a compact self-adjoint operator, then there exists a unique set of pairs $\{(\lambda_i,P_i)\}_{i}$ such that each $\lambda_i$ is a nonzero scalar, the $\lambda_i$ are all distinct, each $P_i$ is a nonzero projection operator, the $P_i$ are pairwise orthogonal, and $$T=\sum_i \lambda_iP_i.$$ Moreover, the $\lambda_i$ are exactly the nonzero eigenvalues of $T$, $P_i$ is the projection onto the eigenspace of $T$ with eigenvalue $\lambda_i$, and each $P_i$ has finite rank.
For the second representation $$Th=\sum_n \mu_n (h,e_n)e_n,$$ the only uniqueness statement we can say is that coefficients $\mu_n$ are uniquely determined (up to permutation) by $T$. Indeed, these coefficients $\mu_n$ are none other than the eigenvalues of $T$, listed with multiplicity. This formula should not look mysterious at all: if we were in a finite-dimensional space and $\{e_n\}$ was the standard (finite) basis, this would literally just be saying that $T$ is the diagonal matrix with the $\mu_n$ as the diagonal entries. So this formula is saying that there exists an orthonormal basis in which $T$ is a diagonal matrix. As usual for diagonal matrices, the diagonal entries are just the eigenvalues (with multiplicity). The orthonormal basis $\{e_n\}$ with respect to which $T$ is diagonal is not unique, just as a diagonalizable matrix does not have a unique basis of eigenvectors.
To relate the two representations, note that if $e_{i_1},\dots,e_{i_k}$ is an orthonormal basis for the eigenspace of $T$ with eigenvalue $\lambda_i$, then the projection $P_i$ onto that eigenspace is just $$P_ih=\sum_{j=1}^k (h,e_{i_j})e_{i_j}.$$ The second representation is obtained from the first representation by just picking an orthonormal basis for each eigenspace in this way and then using this formula for $P_i$. The non-uniqueness of the second representation comes from the fact that there are many different orthonormal bases for each eigenspace.