Switch debouncing in software
The if statement is looking for this pattern:
0b 1111 0000 0000 0000
The previous statement forces 3 of the bits high, so you are checking for this pattern:
0b XXX1 0000 0000 0000
After each sample, the pattern is shifted one to the left.
So, you need 12 consecutive samples low (switch pressed), and the previous sample high (un-pressed).
There is a slight uncertainty due to the sampling, so the debounce range is 12 samples +/- 1 sample. So 12 ms +/- 1 ms.