In order to add a paint layer mask, there must be at least one paint layer.
A new layer mask with the same resolution and bit-depth as the selected layer is created and added under the layer. If the paint layer already has existing mask layers, the new layer mask is added at the top. The layer mask is given a unique name, by default, and is automatically selected.
See also Delete a paint layer mask.