I had a lump in my armpit for one year. It was very small and pain free. Now in 2 days it has become enlarged, swollen and very painful. Is it cancer?

Probably not. If you're a 24 year old male, it's extremely unlikely that you have a cancer causing a lump in the armpit. It is much more likely that it is a subcutaneous abscess. The proper treatment for something like that is I&D (incision and drainage). This can be done under local anesthesia in a doctor's office, preferably either a dermatologist or a general surgeon.