Pretty much every DSLR/DSLM camera out there has a "bulb" mode that keeps the shutter open as long as you hold down the shutter button. I think my personal record is a 20-minute exposure.
As for actually holding down the button, you can either use an external wired shutter button that has a mechanical lock to hold it down, or you use a wired controller that has an electronic timer, or you use a software feature in the camera to set the bulb timer.
For anybody wondering, the reason not to do a single ultra-long exposures is noise.
There's an equilibrium between exposure duration, aperture, and ISO that gives the best results for the conditions with a minimum amount of sensor noise, and getting close to the equilibrium and stacking the images typically gives better results than one massive exposure.