The Ministry of Magic oversees the creation of all new spells.
Hermione is clear that the Ministry of Magic has a role in signing off new spells and checking they're safe. She was annoyed with the Half-Blood Prince because his spells didn't have this approval.
"So you just decided to try out an unknown, handwritten incantation and see what would happen?"
"Why does it matter if it's handwritten?" said Harry, preferring not to answer the rest of the question.
"Because it's probably not Ministry of Magic-approved," said Hermione.
(Half-Blood Prince, Chapter 12, Silver and Opals).
We aren't given any further information about how the Ministry of Magic goes about this approval process. However, there is a body in the Ministry called the Committee on Experimental Charms which probably plays a role in determining whether new spells are safe.
"Here comes Gilbert Wimple; he’s with the Committee on Experimental Charms; he’s had those horns for a while now..."
(Goblet of Fire, Chapter 7, Bagman and Crouch).
As for cases of unlawful spell-creation, these are presumably handled by the Improper Use of Magic Office, which seems like the most relevant bureaucratic arm.
"Level Two, Department of Magical Law Enforcement, including the Improper Use of Magic Office, Auror Headquarters and Wizenganot Administration Services."
(Order of the Phoenix, Chapter 7, The Ministry of Magic).
Of course, just because the Ministry has legal responsibility for overseeing new spells, that's not to say that they actually know what's happening on the ground. After all, all Animagi were meant to be registered with the Ministry and we know that several people flouted those rules. When it comes to making up new spells, we know that Snape did it without permission. It's likely that others created illicit spells as well.
As for how spells come to be taught, as Valorum says, the students learn the spells that are in the textbooks. The teachers are allowed to pick the textbooks themselves, since Hagrid selects the very Hagridy Monster Book of Monsters. So if someone thinks it's worth putting in a textbook and the teacher thinks that book is worth teaching then it will go on the syllabus. Presumably, authors check whether or not spells are Ministry of Magic-approved before they put them in their books.