The size of the alpha map in texels for either the width or the height.
Setting this value, even to its current value, resizes the alpha map textures and resets all splat weights: the first terrain layer gets a weight of 1 everywhere and the other layers get 0.
To keep existing painting, read the weights with TerrainData.GetAlphamaps before you change the resolution, resample them to the new size, and write them back with TerrainData.SetAlphamaps.
To make the change undoable from an Editor script, register both the TerrainData and its TerrainData.alphamapTextures with Undo.RegisterCompleteObjectUndo before you set this value.