I assume you're asking specifically about the convention of putting punctuation inside quotation marks, as in Joy means “happiness.”
According to an article in Slate which quotes Rosemary Feal, executive director of the MLA (Modern Language Association of America), this practice began in the USA "in the early days of the Republic", so around 1800, done for aesthetic reasons (it looked nicer having the punctuation inside the quotation).
More recently there has been a movement in the US for what since the 1960s has been called "logical" punctuation, where marks that are not part of a quotation are placed outside the quotation marks.
However, if you look back at older books you'll see a wide range of actual styles. And there are a lot of questions on ELU SE about logical punctuation: see this search.