In LeNet 5's first layer, the number of feature maps is equal to the number of kernels. However, the second convolutional layer has a depth different from the 3rd layer. Does the filter size dictate the number of feature maps?
In this case, each kernel has the same depth as the depth of the input cuboid. In the architecture above, we have an (input) cuboid of dimension $14 \times 14 \times 6$, where $6$ is the depth, which is followed by an (output) cuboid of dimension $10 \times 10 \times 16$, where $16$ is the depth, which is the number of (output) feature maps (or channels) and it is also equal to the number of kernels applied to the (input) cuboid of dimensions $14 \times 14 \times 6$. Each of these $16$ kernels has a depth of $6$. So, each of these $16$ kernels has a shape of $5\times 5 \times 6$.
In general, the depth of the input cuboid can be different than the depth of the output cuboid, which is often equal to the number of kernels applied to the input cuboid (but this is not always the case). Furthermore, the depth of each kernel (applied to the input cuboid) has (often) the same depth as the input cuboid.
The # of kernels will be the channel length, looking at the image you posted in your comment from post, I do not understand where you see the inconsistency.