Probably most reliable way to define these is from learning perspective, i.e., parameter sets to learn in function composition (deep). Hence, given $N$ layers denoted by $L_{1}$,...$L_{N}$ for deep architectures including input and output layers, there are $N-1$ weight matrices to learn. Biases are associated with them. In this setting, the depth is $N-1$, due to number of compositions (weights matrices) needed for training. Hence, input layer is $L_{1}$ and output layer is $L_{N}$, then the number of hidden layers will be $N-2$.
Block perspective is a bit different, it appears both in Large Language Models (LLMs) and Recurrent Neural Networks (RNNs), they are maybe called logical layers with internal layers