This phase I trial studies the side effects and best dose of ribociclib and gemcitabine hydrochloride in treating patients with solid tumors or lymphoma that have spread to other places in the body and usually cannot be cured or controlled with treatment. Ribociclib may stop the growth of cancer cells by blocking some of the enzymes needed for cell growth. Drugs used in chemotherapy, such as gemcitabine hydrochloride, work in different ways to stop the growth of cancer cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. Giving ribociclib together with gemcitabine hydrochloride may work better in treating patients with solid tumors or lymphoma.