Dragon fruit, also called pitaya and night-blooming cereus (Hylocereus undatus), produces edible, spiny, red or white fruits on long vines. Dragon fruit bears fruits for several months each year, and it can continue to produce fruits for decades when provided with adequate care and cultural conditions.
 
Annual Bearing Season
Dragon fruit bears fruits for five months every year, usually from early summer through mid-fall. It begins flowering in early summer, typically in June, with fruit formation occurring shortly afterward. Dragon fruit flowers are open in the evening and last only one evening. The flowers first form as small buttons, or buds, with two or three buds flowering within 13 days of their formation. It takes the fruits about 50 days to reach maturity after flowering and pollination occurs, and the dragon fruit continues to flower and set new fruits throughout its fruit-bearing season.

 
Plant Lifespan
Dragon fruit is a relatively long-lived perennial. It can produce its first fruits within one year of its establishment, and it can continue to fruit annually for 20 to 30 years before it begins to decline. Dragon fruit can grow up to 40 feet tall, with the large and tall specimens producing more fruits than the small, young plants or those reaching the end of their lifespan.
 
Climate and Fruiting
Warm weather and moist soil can increase the fruit-bearing season of a dragon fruit plant. In an area where temperatures remain above 80 degrees Fahrenheit, a dragon fruit may flower and set fruits beyond the normal bearing season. In a cooler climate, the bearing season may be shorter than the usual five months. Cool nighttime temperatures may prolong flower life, giving the blooms more time to become pollinated before they wilt and die, but fruit set isn't affected when the days are warm.

 
Increased Fruiting
You can increase dragon fruit's fruiting during the bearing season by properly watering the plant. Although a cactus, it grows and produces best when its soil remains moderately moist. Provide about 1 inch of water weekly, or enough so the soil doesn't dry out completely. Avoid keeping the soil wet or soggy, which can cause the cactus to rot. Provide the dragon fruit with full, all-day sunshine to encourage a full fruit- bearing season. Dragon fruit normally is pollinated by moths that are active at night, but you can pollinate the flowers by using a small paintbrush to transfer pollen from the stamens to the stigmas inside the flowers.

(Source: homeguides.sfgate.com)