When a washing machine is filling with water it should need the power to be on and a fill type selected. When the power supply is stopped and the water keeps running. It is not your tap as a lot of people think; it is a part called an inlet water valve.
The valve has a solenoid coil that when activated pulls a plunger away from a diaphragm, allowing the water to fill the machine.
Once the machine is turned off the plunger returns and the water will stop immediately.
If the water still drips trickles or runs the inlet valve needs to be replaced.