Technically, I think a glitch is actually a problem in processing rather than code. No one uses it like that anymore, but a glitch is where something goes wrong that shouldn't. And a bug is just an error from the coder.
A glitch might be where your CPU is adding 2 + 2 and it ends up with 5.
A bug is where the program should have said 2 + 2, but said 2 + 3 instead so you get 5.