What causes gums to get discolored?

Permanent. Discoloration can be due to certain chronically taken medication, melanin pigmentation, or metals leeching from restorations or actual particles of a restoration becoming engulfed by macrophages within mucosa and becoming permanently "deposited". Certain disease processes can also lead to discolored gingiva. Discoloration can range from dark brown, blue, reddish or white or admixture of these.
Many things. It can be a hereditary thing, from medication, various inflammatory diseases, and metal deposition.
Discoloration of gum. If there is no history or signs of periodontal diseases , then discoloration can be normal pigmentation , depending on the race and nationalities. But if the discoloration was not there before and happened only recently , then need to rule out periodontal diseases first via exam and x-rays.