Review the formula for the perimeter of a rectangle:
P = 2W + 2L. Here the Perimeter is 24: 2W + 2L = 24 (where x=W=width).
Certainly we could talk about y in terms of x:
Starting with 2W + 2L = 24, subtract 2W from both sides (recalling that W=x)
2L = 24 - 2x
Reduce this by dividing all 3 terms by 2: L = 12 - x, or y = 12 - x
Note that y cannot be negative, nor can x be negative. Thus, the greatest value y can have is 12, when x = 0. Actually, x cannot be zero, or we'd have a straight line, not a rectangle.