The difference is simple: MMA is the sport, UFC is the biggest promoter in it.
MMA stands for mixed martial arts, a full-contact sport modelled on ancient Greek Olympic competitions, where fighters from different disciplines such as wrestling and boxing face each other. Punches, kicks, throws and grappling are all allowed, with the aim of finding the fighters who blend those techniques best.
UFC stands for Ultimate Fighting Championship. Founded in 1993, it is the world's biggest promoter of MMA fights. Throughout the year, the organisation stages events across various weight classes. Fights take place in an octagon and usually last three or five rounds of five minutes each. Victory can come by knockout, technical knockout, the opponent's submission or a points decision after the full duration.
Unlike completely unrestricted MMA, the UFC bans some techniques. For example, fighters cannot jab fingers into the nose or eyes, strike or kick the back of the head, or kick opponents who are on the ground.