Approximately 300 million years ago. The only known hagfish fossil looks a lot like modern hagfish, and scientists have speculated that they haven’t changed much since then.