It is grown in a pet's garden from the special Fizzy Fruit Mystery Tree Seed. To get this seed, you must purchase a bottle of Dr. Pepper in real life and get a code from the inside of the soda bottle lid. This code is redeemable at the Dr Pepper promotional website at http://www.drpepper.com/promotions/ea/. These bottles are only sold in the United States; if you are outside of the US you can only get this seed by trading.
After planting, it will take 72 hours for the tree to reach maturity. Afterward, the tree will begin producing fruit, one fruit at a time, randomly. A pet can have up to three total apples on the tree at once, unless you have the Fruit Fairy, in which case you will produce up to four.