Water hammer is, most generally, a name for the large energy and momentum transfer which occurs when flowing water collides with something. Since water is almost totally incompressible, being hit with a moving mass of water is dynamically very similar to being hit with a solid, rigid object (all you fire-hosed protesters know what I'm talking about). Water hammer is related to hydrostatic shock, which is a general term for the excellent ability of an incompressible fluid to transmit a physical blow; in this case, the shock comes from the initial momentum of the water itself rather than an external impact.
Water hammer presents both challenges and applications for engineering in various fields. One of the more common and close-to-home issues with water hammer is in household plumbing. When a user suddenly closes a valve, e.g. a faucet, the moving mass of all the water in the supply pipe behind the faucet suddenly has nowhere to go. In a crude plumbing installation without accommodations for water hammer, the result will be an audible "knocking" of the pipes as thought they were bashed on with a blunt instrument (which in fact they were). This is especially severe with water-drawing appliances, like dishwashers, which use mechanically actuated valves that close very quickly. The standard workaround is to install a shock absorber behind the faucet or appliance, consisting of either a simple air chamber or a specialized water hammer arrestor. An air chamber for this purpose looks like a vertical appendix of pipe protruding from the final elbow joint, and contains a semi-permanently trapped air bubble. Air is compressible, unlike water, so the force of the water hammer is absorbed in compressing the bubble which softens the blow to the enclosing pipe. A simple air bubble will be gradually lost over time, so many applications now use specially constructed arrestor units which contain the gas bubble in a sealed bladder or behind a piston.
There are applications in which water hammer can be used as a tool. It can be considered a positive feature of hydraulic systems, in that sharp impulses can be transmitted without "softening". Water jets are also useful in smashing and cutting situations, where they replace solid implements which are prone to wearing out; mining and industrial metal cutting both make extensive use of this. A water jet is as merciless as a metal blade or bit, but is also relatively simple to direct and control since the driving systems can be abstracted from the nozzle or delivery system. This is one reason why water cutting is in particular used for computer-automated fabrication.