Computers have several devices built in that can cause signals to be sent to the processor for special processing - one of these is a timer that can be set to trigger an event when a certain amount of time has passed.
There are several ways for computers to deal with these events, one of which is called an interrupt. An interrupt basically causes the processor to jump to a certain piece of code when an event occurs.
On the PC there are many different interrupt types, and each can be handled by a different piece of code, the addresses of which are held in a table - when the processor receives an interrupt for the timer event, it selects the timer interrupt address from the table, and jumps to that piece of code to execute it.
That code will save the current context, which includes, but is not limited to, the old instruction pointer (before the jump), the stack pointer, the general purpose registers, the floating point registers, the segment registers and the flag register.
It will then determine which process should be the next to get some processing done, and will restore the context for that process, ending by jumping to the instruction saved for that context.
Between saving one context and restoring the next, the OS gets its chance to do a little housekeeping, and in addition, the context it restores may actually be one of it's own if a larger amount of processing needs to take place.
Also, it isn't just the timer that can cause these kinds of interrupts - there are all sorts of events that may need to be dealt with, such as network traffic, keyboard/mouse activity, data received from the hard-drive from a previous data fetch etc.