In the last few months, I have been remodeling my basement bathroom (some of the work I've been doing myself, and some work has been contracted out). I recently had the bathroom vanity and faucet replaced by a bathroom remodeler. After they installed the sink / faucet / P-Trap and had left for the day, I turned on the faucet to check for leaks in the newly installed a Oatley P-Trap (cheap polypropylene plastic).
After the water had been running for a bit, I started to hear a loud knocking noise in the back of the wall. The random tapping or clicking sound would sometimes even continue for minutes after the water had been turned off.
The old bathroom had a working faucet that I never noticed any noises previously when the water taps had been opened / running or after the faucet had been turned off.
I tried various things to diagnose the problem. I tried shutting off the hot water, and just running the cold water, but the knocking noise persisted. I then discovered that the 1 1/2" P-Trap was slipping down the sinks 1 1/4" tailpipe (tightening the P-Trap lock nut did not work). Two days later I bought the "RED colored" Oatley 1-1/2 in. x 1-1/4 in. Sink Drain Pipe Rubber Slip-Joint Washer and changed out the Blue washer that was being used on my sink's tailpipe. While the Red and Blue slip joint washer seemed to be the same size, the Red washer is stiffer and slightly bigger. This change helped keep the P-Trap from slipping down, and to a small extent may have quieted down the knocking noise due to less movement of the P-Trap and drainpipe.
But while I was fiddling with the P-Trap, I noticed that the hole for the drain in the back of my new Vanity the contractors drilled out was rubbing right up against the drain pipe on the left side of the vanity. So, I took a razor blade and cut the wood on the vanity around the drain hole to make an air gap between the hole of the vanity and the drainpipe, so now the drain piping and vanity were no longer touching. Doing this made a huge difference with the loudness of the ticking sound and how often the sound occurred. But it didn't completely solve the clicking / ticking noise from occurring when either hot or cold water was running or had been turned off.
It then occurred to me, the old vanity had been facing in a different position (on the wall perpendicular to where the pipes came out) and had at least a 1/2" gap between the side of the vanity and drywall where the water lines and drain line came out of the wall. The new vanity was positioned on the back wall facing the water lines and also where the drain line goes into the wall. So now the back of the vanity's wood was flush with the drywall (no gap between the vanity and the wall). I then noticed that the hole in the back of the vanity where the P-Trap drain line headed to, had drywall that was really compressed up against the bottom of the drain line as it curved down before going straight down into the concrete floor... (luckily I was able to notice this, because the remodelers had cut the hole big enough in the back of the vanity so I could see the bottom portion of the drainpipe area. So, I then decided to take a mini screw driver and break up the drywall that seemed to be pinching the curve of the drain pipe (as it curves straight down). I was able to clear out enough drywall that had been scrunched up tightly against the drain pipe curve so that the drain pipe was no longer tightly resting or being pressed onto the drywall. This drain pipe curves down and is really close to the back of the drywall as well.
Once I removed the tightly compressed drywall from around the bottom front edge of the drain pipe (as it curves down), the ticking, knocking or banging sound miraculously went away! So I believe the ticking sound was expansion and contraction of the drain line at the curved downward section in the back of the wall as it was pushed too tightly against the drywall, which then reverberated throughout the wall and vanity. Once the pressure was relieved around the drainpipe, by creating more room for the drainpipe to "breath", the sound thankfully disappeared.
NOTE: Things to try: I would also close the sink drain and run the water on your faucet (hot or cold), and see if you still hear a noise in the back of your wall. If you don't hear noise, when your sinks drain is plugged with its stopper, then it's more likely to be a drain issue, and not a Hot or Cold water line issue.
Before finishing my bathroom, I had removed all the drywall in the back of my wall (except for a 1 or 2 feet around the water and drain line at the bottom of the wall), so I know where the water lines and drain lines are coming from. So I was a bit concerned it was the cold water line being knocked into the drainpipe because the water lines come down from the ceiling in the back of the wall, and the hot and cold water lines can still be moved back and forth a little bit by hand (I should have secured them to the back of the wall when the drywall was removed, but I didn't think about it at the time).
In any event, hopefully this might help you figure out your noise when running a kitchen or bathroom faucet, or at least help give you an idea what might be causing your water ticking sound (FYI, I pretty much knew this was not water hammer noise from the start as I've previously dealt with Water Hammer noise after installing an Aprilaire Humidifier).