To turn off your Ledger Nano X, go to the Control Center on your device by holding down both buttons for three seconds and then choosing the Power Off option.
You can also set your Nano X to auto power-off by going to the Control Center and navigating to Settings > General. After that, press both buttons to enter the Battery Saver menu and then select how long you'd like your device to wait before powering off.