Dragon Fruit will keep just fine out on the counter or out in the open for a few days.
But if you want to keep the dragon fruit longer than a few days then you should place the dragon fruit in a plastic bag and store the dragon fruit in the refrigerator.
Before storing the dragon fruit in the refrigerator cut the dragon fruit into quarters or slices, and peel off the skin.
The skin of dragon fruit is not edible and should be thrown away.
Store the cut up pieces of dragon fruit in the plastic bag in the refrigerator and it should last up to a week or until the dragon fruit starts turning yellow or brown which means that the dragon fruit is spoiling and should be thrown out.