An xray is one image. Sometimes they might take a few more. CT and MRI scans are many more images. What's more, they aren't all taken from the same place, so you have to be moved into position a few times or the equipment needs to move around you or both.
If contrast is needed, the whole thing needs to be done twice - once without and once with contrast. (Or in my experience, each part needs to be done twice so they do the body without and with, then change where my arms are, reposition the bed, and do the head without and with.)
Where I get my scans done there is also a pause while a radiologist looks at them to see if it is all clear and readable or if some parts need to be redone. I typically spend 45 minutes on the bed for MRIs (just my hip, no contrast) and 20-30 for CTs (whole body[*], with contrast)
There is also substantially more "prep" time -- I've had Xrays with my clothes on, but for CT and MRI scans you have to get into a gown, multiple people ask you the same questions you just answered on the form, if there will be contrast someone starts an IV, and so on.
*
a "whole body" CT scan does not include your arms, legs, or anything above your nose. It doesn't even do hips very well. It's really most-torso-plus-throat-and-mouth.