The domain name is transmitted as a sequence of labels plus one byte for each label's length, followed by a null byte for the root label. Everything together must fit into 255 bytes.
So the domain name x.y.z (technically x.y.z. with the empty space after the last dot representing the root label) uses the following bytes:
[length of x][x][length of y][y][length of z][z][length of root label, i.e. 0]
Since we usually add dots to visually separate labels, you can imagine the dots and inner length bytes cancelling each other out, leaving the first length byte and the last null byte as the two "missing" bytes.