According to the 50% rule, you should replace an item instead of repairing it if the cost of replacement is greater than 50% of the cost of repair.
However, you should keep in mind the frequency of repairs and the age of your water heater even if your current repair does not equal 50% of a new water heater.