Let me elaborate a bit more.
Diagonal self-adjoint operators
Let $\mathsf{H}$ be a (separable) Hilbert space with an orthonormal basis $(e_n)$. Take a non-empty compact set $K \subset \mathbb{R}$ and a sequence $(\lambda_n)$ of distinct points from $K$ such that the closure of the set $\{ \lambda_n \colon n \in \mathbb{N}\}$ is $K$.
We construct a self-adjoint operator on $\mathsf{H}$ with spectrum $\sigma(A)=K$ by setting
$$Ax = \sum_{n \in \mathbb{N}}\lambda_n \left<x, e_n\right>e_n$$
for all $x \in \mathsf{H}$.
The function $E \colon \mathcal{B}(K) \rightarrow B(\mathsf{H})$, where $\mathcal{B}(K)$ stands for the set of all bounded Borel function on $K$ and $B(\mathsf{H})$ is the space of linear bounded operators on $\mathsf{H}$, defined by
$$E(B)x = \sum_{n \in \mathbb{N}} \textbf{1}_{B}(\lambda_n) \left<x,e_n\right>e_n$$
is the resolution of identity (spectral measure, link) for $A$ and it is often denoted by $\mathbf{1}_B(A):=E(B)$ (this notation is consistent with the application of functional calculus, discussed further in the answer) for all $B \in \mathcal{B}(K)$. Furthermore the following holds
$$(\star) \ \ \qquad Ax = \int_{\sigma(A)} \lambda \ E(\mathrm{d}\lambda)x = \sum_{n \in \mathbb{N}}\lambda_n \left<x, e_n\right>e_n,$$
where $\int_{\sigma(A)} \lambda \ E(\mathrm{d}\lambda)$ is an integral with respect to the spectral measure $E$ of $A$ (I'm not going to define this integral here, check this link, $(\star)$ supposed to give the intuition).
Notation
In Physics people often use the Dirac notation, that is, since the above $A$ can be written by $\sum_{n \in \mathbb{N}} \lambda_n \left|e_n\right>\left<e_n\right|$ or even $\sum_{i} \lambda_i \left|i\right> \left<i\right|$ (if we use the notation $(\left|i\right>)$ to denote the orthonormal basis) then the following notation can be often seen $$A = \int \lambda \ \mathrm{d}\left|i\right>\left<i\right|$$
for any self-adjoint operators (not-necessarily diagonal).
General case
Now take an arbitrary self-adjoint operator on $\mathsf{H}$ (not-necessarily diagonal). The spectral theorem states that
$$A = \int_{\sigma(A)} \lambda \ E(\mathrm{d}\lambda),$$
where $E$ is the corresponding resolution of identity (spectral measure) for $A$.
In particular, one may want to consider the Borel functional calculus. Given a bounded borel function $f \in \mathcal{B}(\sigma(A))$ we have that
$$ f(A) = \int_{\sigma(A)} f(\lambda) \ E(\mathrm{d} \lambda).$$
Name
The term identity in the name probably comes from the fact that
$$\mathbf{1}_{\sigma(A)}(A) = I_{\mathsf{H}},$$
and I think that resolution corresponds to the spectral form of the operator.
Spectral theorem - different version
There is also a multiplication operator version of the spectral theorem which says that any self-adjoint operator is unitarily equivalent to the operator of multiplication on some space $L^2(\mu)$ for some measure $\mu$. Recall that a multiplication operator with symbol $f\in L^{\infty}(\mu)$ is $M_f \in B(L^2(\mu))$ given by $(M_f g)(x) = f(x)g(x)$. One may want to check this link for further information.
In particular, the spectral measure for multiplication operator $M_f$ is given by $E(B) = \mathbf{1}_{f^{-1}(B)}$ for $B \in \mathcal{B}(\sigma(M_f))$.