Is this sentence correct?
I wonder, is it time for breakfast?
"I wonder" sentences end with full stop, but what if it is separated by comma as in above sentence? Would it still be wrong to put the question mark?
Yes, the sentence is correct. It is correct because "I wonder" is being used as an "introductory phrase"
An inroductory phrase is a group of words that comes before the main clause in a sentence. It helps the reader understand more about the main clause.
Would work as a correct sentence without the introductory phrase
Some introductory phrases that are commonly used include
Each one of these examples could be altered to make the phrase a component of the sentence without it being part of an introductory phrase. In some cases, very short introductory phrases might not even require a seperating comma, but those cases are rare. Typically a comma is used.
Which I prefer
https://grammar.yourdictionary.com/using-introductory-phrases-correctly.html
I wonder if it's time for breakfast. [most usual, no comma]
Is it time for breakfast, I wonder? [comma, the wondering is an afterthought]
That's really two sentences or, at least two separate thoughts, rather than one (although you could make them into a single sentence by connecting them with whether and adjusting the word order slighly.)
The question is really just about how to punctuate them. The comma isn't ideal, as it denotes a pause or separation in one sentence.
I would suggest a semi-colon, which is used to connect two related ideas. It's somewhere between a comma and a full stop (period):
I wonder; is it time for breakfast?
or, an exclamation mark:
I wonder! Is it time for breakfast?
or possibly a dash (although many might frown on this as lazy)
I wonder - is it time for breakfast?
https://www.thepunctuationguide.com/semicolon.html
http://www.sussex.ac.uk/informatics/punctuation/