It's the pressure relief for the hot water cylinder. If the water in the cylinder gets too hot, it expands and overflows out that pipe. It's a second line of defense. The thermostat should stop heating before it gets to that point and there's a valve that stops water being added to the cylinder when the pressure reaches a cutoff point. Ideally, there would never be anything coming out of that overflow. In practice, it will have a bit of a spit and gurgle every so often. That's normal. If it does it continually, get a plumber to have a look at it.
I'm not a lawyer or a plumber and my plumbing advice is worth as much as my legal advice.