The length of time that dragon fruit will last after being cut depends on the ripeness of the dragon fruit.
Typically dragon fruit once cut open will last from 3 to 4 days before it goes bad.
So as long as you eat the dragon fruit within 3 to 4 days the dragon fruit will be okay to eat and after 4 days the dragon fruit should be thrown out.
You can tell when dragon fruit is starting to spoil by looking for brown or yellowing of the fruit.
If you notice browning or yellowing of the dragon fruit then it's going bad and should be thrown out.