The questions says it all. What's the difference between a peace treaty and a non-aggression pact?
A peace treaty is a formal agreement to end an ongoing war. Note that a formal peace treaty is not the only way to do that (just like you don't need a formal declaration to start a war). The Second World War, for example, ended without there being an official peace treaty between Germany and the allied nations until 1990.
Non-aggression pacts are an agreement to not start a war to begin with. These were popular between world war 1 and the end of world war 2, but fell out of favor. The reason is that there are no real consequences for breaking a non-aggression pact between two countries. That means it doesn't provide any actual security against a war. For example, Nazi Germany and the USSR made a non-aggession pact in 1939 which was broken by Nazi Germany in 1941 as soon as they found it convenient. In fact, making a non-aggression pact is often considered a sign of aggression in the first place, as it implies that aggressions between two countries are not completely unthinkable.
Since the founding of the United Nations non-aggression pacts have become very rare in international politics, because the UN charter forbids aggression and thus puts the whole world into a non-aggression pact to begin with.