By its behavior, location, cellular markers, and/or appearance. It really depends on the cancer.
Just to frame, the difference between a benign and malignant tumor can look like this:
First, a cluster of cells arises that will now divide outside the normal pattern (e.g. keeping one side of the environment in one direction, etc.) Oh, but it can't form a cancer because it still responds to the immune system.
Next, it develops a mutation that expresses an immune-inactivating surface ligand. Now it can both divide in the wrong orientation, and it can deactivate the immune response to itself. Oh, but it runs out of blood supply quickly as the tumor grows.
Next, it develops a mutation that lets it release molecules that signal new vascularizaiton (e.g. veins). Now it has a fresh blood supply and plenty of nutrients to continue growing. Oh, but it still only knows how to divide within this specific tissue environment in contact with other like cells.
Next, it develops a mutation that allows it to divide without any contact. It is now a metastasizing tumor, and can spread to many different tissue types (this is usually where the host dies).
The path from normal tissue --> benign tumor --> malignancy is a spectrum. Some cells have to go through ~8 major mutations, others only have to go through ~2. There are a wide variety of tumor-promoting mutations in skin cells, for example, that are benign unless you go through a long list like above.
A malignant tumor's cells are actively trying to escape the tumor and spread throughout the body, growing new tumors elsewhere. A benign tumor's cells are content to stay where they are, and aren't threatening other parts of the body. When a benign tumor turns malignant, it's because the benign tumor's cells have started to spread.
This spreading is called "metastasis".