Trees release oxygen when they use energy from sunlight to make glucose from carbon dioxide and water. Like all plants, trees also use oxygen when they split glucose back down to release energy to power their metabolisms. Averaged over a 24-hour period, they produce more oxygen than they use up; otherwise there would be no net gain in growth.
A human breathes about 9.5 tonnes of air in a year, but oxygen only makes up about 23 percent of that air, by mass, and we only extract a little over a third of the oxygen from each breath. That works out to a total of about 740kg of oxygen per year. Which is, very roughly, seven or eight trees’ worth.