This quote comes from the Babylonian Talmud Shabbat 31A-1 as being said by Hillel. Here is the quote from the Talmud: “On another occasion it happened that a certain non-Jew came before Shammai and said to him, “I will convert to Judaism, on condition that you teach me the whole Torah while I stand on one foot.” Shammai chased him away with the builder’s tool that was in his hand. He came before Hillel and said to him, “Convert me.” Hillel said to him, “What is hateful to you, do not to your neighbor: that is the whole Torah; the rest is commentary; go and learn it.”

I have also seen the quote as written above in a few locations; each time sourced back to Rabbi Hillel, or just Hillel.