The length of the garden is 76 feet.
If the perimeter is 254 and the width of the garden is 51 feet, you must multiply the width by 2 (102) and than subtract that from the total perimeter (254 - 102 = 152) than divide the leftover amout by 2 (152 /2 = 76) making the length of the garden 76 feet long.