The title basically says it all. The question is not too easy to google:
What is the maximum time I can block the UI thread without creating a noticeable 'lag' in the UI from the user's perspective?
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It only takes a minute to sign up.Sign up to join this community
The really short answer is 100ms.
Mr. Nielsen is a recognized authority on UI design, and does a tremendous amount of analytical research related to UI design.
The article and book give these numbers:
0.1 second is about the limit for having the user feel that the system is reacting instantaneously, meaning that no special feedback is necessary except to display the result.
1.0 second is about the limit for the user's flow of thought to stay uninterrupted, even though the user will notice the delay. Normally, no special feedback is necessary during delays of more than 0.1 but less than 1.0 second, but the user does lose the feeling of operating directly on the data.
10 seconds is about the limit for keeping the user's attention focused on the dialogue. For longer delays, users will want to perform other tasks while waiting for the computer to finish, so they should be given feedback indicating when the computer expects to be done. Feedback during the delay is especially important if the response time is likely to be highly variable, since users will then not know what to expect.
The article provides citations for the basis of those numbers. In a later blog post titled Powers of 10: Time Scales in User Experience he expands on this topic.
It depends on what the application is doing and on what your users are used to.
For a desktop application users are used to not having a responsive UI during startup or potentially file open for a variety of applications. but during other tasks, e.g. typing, even very small pauses will cause negative experiences.
There does appear to be a human limit of about 0.1s at which we perceive things to be more or less instantaneous, so, as some commenters have mentioned, always responding within 0.1s is certainly one way to meet user expectations (it might be technically hard to meet this however)
As expressed in other answers, the 100 ms response time is a good limit. It is a good limit for desktop applications, but we already know that for certain applications this time might be too slow.
For console games for example the "input lag" of the TV is often considered to be bad when exceeding 30-40 ms. So here the expected responsiveness must be better than 100 ms to have a good product. So it also depends on the domain where the application is used in.