Short answer. Tl;dr:
Yes/no questions just require an auxiliary verb to appear at the front of the sentence. This leaves the rest of the sentence in tact. This is what happened in the Original Poster's Do example.
Open questions require the interrogative word or phrase to be moved to the front of the sentence (when it is not the subject). This disrupts the rest of the sentence and can break up constituents. This is what has happened in the Original Poster's example with What time.
The full story:
Do you know what time it is?
What time do you think it is?
Example (1) is a yes/no question (also called a polar question or a closed question). To make a polar question we take the auxiliary verb and move it in front of the subject:
- You can swim --> Can you swim?
- She has finished --> Has she finished?
Sometimes a sentence doesn't have an auxiliary verb as standard in the declarative version. In these cases we use the dummy auxiliary, the verb DO:
- You take sugar --> You do take sugar --> Do you take sugar?.
This is what has happened in example (1):
- You know what time it is --> You do know what time it is --> Do you know what time it is?
Notice that although the speaker of such a sentence actually wants the listener to tell them what time it is, the technical answer to their question is either 'Yes' or 'No'. And if the listener wanted to be facetious they could easily give one of those answers as a very annoying joke.
Example (2) is rather different. It's an open question. The technical answer to (2) is not 'Yes' or 'No', but rather '2.15' or '3am' or whatever the time happens to be. It called an 'open' question because there is in principle no limit to the number of different answers one might give.
To make an open interrogative, we first need to replace the item we want to know the identity/value of with an interrogative word, like who or why and so forth:
- You met xyz --> You met who?
- Xyz ate the pies --> Who ate the pies?
Then if we want to make a conventional open question, we move the interrogative word or phrase to the front of the question:
- *Who you met
who?
- Who ate the pies?
But, as you can see from the examples above, that is not always sufficient. The second example, where the interrogative word is the subject is fine. However the first example—where we had to move the interrogative word from a different position to get it to the front of the sentence—is ungrammatical. In these cases, we also need to move the auxiliary verb to in front of the subject. And just like with yes/no questions, if we don't already have an auxiliary, we insert the dummy auxiliary, DO:
- You met xyz --> You met who? --> Who you met
who? --> Who you did meet? --> Who did you meet: Who did you meet?
This is what has happened in the Original Poster's second example:
- You think it is what time? --> What time you think it is? --> What time you do think it is? --> What time do you think it is?: What time do you think it is?
Executive summary [As Prof Lawler used to say]:
In yes/no questions we only move the auxiliary verb to the front of the sentence. The rest of the clause remains undisturbed. In other words the rest of the sentence is the same as it would be in a declarative clause.
In open questions we often have to move the interrogative phrase from another part of the clause. This can often break up larger constituents within the sentence, and also means that open questions can look considerably different from their declarative counterparts.
Authoritative source
All of the information above can be found in Rodney Huddleston, Geoffrey K. Pullum and Brett Reynolds (2022) A student's introduction to English grammar. Cambridge University Press.