I'm not familiar with all tests out there, but I'll give an example from the fourth revision of the Wechsler Adult Intelligence Scale (WAIS-IV), one of the more popular tests.
The time to complete the whole test does not matter (as long as you complete it in one go without long breaks). Usually testing takes between one and two hours, but if you test very old and frail persons, you might even administer parts of the test on different days.
I have not heard of any IQ test that has an overall time limit for the whole test (which does not mean that there is none). In my opinion that would not work for a paper and pencil test, because there are breaks between subtests where the test administrator gives the instructions for the next subtest, and short breaks where the administrator reads out the questions for individual items of a subtest. Thus, the overall time would depend not only on the test subject, but on the administrator of the test as well. In a computer administered test, it would be possible to measure the time used to solve the questions accurately, but, as I said, I don't know of such an IQ test.
In the WAIS-IV, many subtests have a time limit. For example there is one subtest where you have to mark certain geometrical forms (e.g. a yellow triangle) on a page filled with many different tiny geometric forms. Obviously, given enough time, everybody would be able to complete that subtest without errors. But you have a limited time in which you have to find as many of the specific forms as you can. There are enough forms that no-one can finish that page in the given time. So the number of forms you find and the number of errors you make are your score for this subtest. Other intelligence tests have similar time limits for certain subtests.