Input events, like key-down, are buffered. When Windows receives the notification from the keyboard driver, it stores the event in the message queue. Which is owned by the thread that owns the foreground window. It will sit there however long it takes to be retrieved by your program. It needs to call GetMessage() or PeekMessage().
How long that takes is entirely unpredictable, it depends on how responsive the UI thread of the program is. Or in other words, how quickly it dispatches messages that it receives and calls GetMessage() again to retrieve the next messsage. A UI thread going comatose for a while is not unusual. Even on fast processors, a poorly written program that executes a dbase query that returns thousands of rows and waits for its result is common enough.
The buffering ensures that this doesn't cause a problem. No matter how fast the user types, his keystrokes cannot get lost.