A bang in the wall when a tap or an appliance shuts off is water hammer. It happens because moving water has momentum, and when a valve closes quickly that momentum has to go somewhere. The result is a pressure spike that travels through the pipework.
It is most noticeable with appliances, because washing machine and dishwasher solenoid valves close far faster than a hand operated tap.
The reason it is worth addressing rather than living with is what the repeated shock does over time. It can loosen joints, stress fittings and eventually cause a leak in a spot that was previously sound. Loose or poorly secured pipework makes the noise worse, because a pipe that can move will knock against the structure.
Remedies depend on the cause. Water hammer arrestors absorb the shock. Securing loose pipework stops the knocking. Where system pressure is unusually high, adjusting or fitting a pressure limiting valve reduces the severity of every spike.
For a burst pipe or a serious leak, turn the water off at the mains tap before you call. If water is anywhere near power points, the switchboard or light fittings, stay clear and treat it as an electrical hazard. Do not enter standing water in a room with live power.