If $A$, $B$ $\in K^{n \times n}$ are $n \times n$ matrices over a field $K$, then we say that $A$ and $B$ are congruent if there exists an invertible $P \in GL(n, K)$ such that $B = P^TAP$, where $P^T$ denotes the transpose of $P$.
Why do we require $P$ to be invertible?
Congruence of matrices is usually compared to similarity of matrices, where we say that $A$ and $B$ are similar if there exists an invertible $P \in GL(n, K)$ such that $B = P^{-1}AP$. Here it is obvious why we need $P$ to be invertible. However, in the case of congruent matrices, the invertibility requirement doesn't seem to be obvious.
We need that congruence is an equivalence relation. If we have $A\sim B$ iff $B=P^tAP$ for some $P$, then reflexivity says that also $B\sim A$ should hold, i.e., $A=Q^tBQ$ for some $Q$. If $P$ is invertible, this follows easily. If not, we have a problem. For example, for every matrix $A$ we would have $A\sim 0$ with $P=0$, but $0\sim A$ would force $A=0$, which is not true for all $A$.