If the quote is a question but it needs a comma after it to separate it from the rest of the sentence, how are the two punctuation marks put together? For example, The king continued to question the boy saying, "Where were you?", but the boy refused to answer. Are the question mark and comma placed correctly?

With a mark of punctuation already there within the quotation marks, you don't need the comma.

http://grammar.ccc.commnet.edu/grammar/commas.htm
Read #6 and #11

http://grammar.ccc.commnet.edu/grammar/marks/quotation.htm
Scroll down and read Double Punctuation with Quotations

Yes, in your example sentence, both the question mark and the comma are placed correctly. When a question is quoted within a sentence, both the question mark and the comma should be used. The question mark is placed inside the quotation marks because it is part of the quoted question. The comma is placed outside of the quotation marks to separate the quoted question from the rest of the sentence. This is the correct punctuation for this situation.

So, to answer your question about how the two punctuation marks are put together, the question mark is placed inside the quotation marks and the comma is placed outside of the quotation marks. This combination effectively separates the quoted question from the rest of the sentence while maintaining proper punctuation.