How do you tell the difference between a canker sore and oral cancer?

Time and/or Biopsy. A canker sore wil go away in a short period of time (usually days). Oral cancer won't. Only definite way to know is with a biopsy.
May need biopsy. Canker sores are usually superficial painful ulcers that tend to heal in a matter of days. Cancer, among other presentations, is a non-healing ulcer, usually painless, more apt to bleed with induration of affected area. Some times it may take a biopsy and examination of the tissue by a pathologist to settle the diagnosis.

Related Questions

What can be the difference in a canker sore and what oral cancer looks like?

Canker sore. See the adjoining photo to see what a canker sore looks like. It's gone in 2 weeks at most. If you want to see what oral cancer looks like, do a google search as you will probably find at least a thousand pictures ; they all look different base on type, size, location and duration. If you have any lesion, especially one that last more than two weeks, see an oral surgeon for a definitive diagnosis.
Canker sores. Is the most common oral lesions. Most tongue ulcers, infections will clear up by themselves within a week or two. You should see your GP or dentist if the ulcer gets worse or lasts for longer than 2 weeks. Oral cancer appears as a growth or sore in the mouth that does not go away. If concerned see your dentist ASAP.

I dipped for 2 years and the other day I got a bump. It got bigger till it turned into what looks like a canker sore. But not white. Oral cancer?

Hopefully not. Dipping is an absolutely terrible habit and you should stop immediately. Look at this as a warning sign. On the other hand, this is a very new lesion. It would be too early to worry that this is cancer. I would advise close observation. If this were to persist, get larger, or bleed you must see a doctor for evaluation.
You should see MD. You should see an oral surgeon and have it biopsied. Absolutely, need to rule out oral cancer. Nowadays incidence of oral cancer is increasing and this is related to hpv infection.
Canker sore? Check with your dentist. If it heals on its own it is probably not oral cancer. If necessary have the area biopsied. Better to be sure and be safe.