Firstly, you could think of it as a question of style alone, and the answer depends on the style manual that is applicable in each case.
On the other hand, an important point in cases such as these is if what is being quoted (enclosed in quotes) is a complete sentence or a fragment. If it is complete sentence, it comes with its own terminal period, which will be part of the quotation and so will be within the pair of quote marks. If not, the overall sentence will end with period after the quotation, that is, after the closing quotation mark. This should be the principal criterion unless the applicable style overrides.
He is such a "good guy". -- quoting a phrase
He said, "He is such a good guy." -- quoting a sentence
He said, "He is such a good guy.". -- quoting sentence, with normal terminal period if style requires it.