"do you have time" or "do you have the time"?
Solution 1:
This is a case where either way works, and they are both commonly used. In this kind of sentence, "time" can be used in the uncountable sense and you can also add clarification of an amount to the sentence. Or, you can refer directly to the specific time being discussed.
Another example would be, "Do you have water to give me a drink?" vs. "Do you have the water to give me a drink?" The first case refers to water in general and adds clarification of an amount. The second case refers to the specific water being requested. Again, both versions are fine.
Solution 2:
Articles are used before countable nouns. The time means the required duration, which is countable in terms of mins/hours, for a particular activity.
However, time, can also be uncountable based on the context.
English Grammar on time