Plants are living things and their metabolism constantly 'burns' food using Oxygen and producing CO2, they do this all the time, day and night.
However, during the day plant is bombarded by photons (i.e. light). The light allows the plant to photosynthesise, turning CO2 and water into Hydrocarbons for food and releasing Oxygen.
The amount of Oxygen produced is surplus to its metabolic requirements and is therefore released into the atmosphere.
At night photosynthesis closes down because there is no light so the plant consumes oxygen and releases CO2 like animals.
However, please note that there are a special group of plants (plants that live in desert climates) that have modified how and when they take up CO2.
In this special group of plants (called CAM plants) the CO2 enters the plant at night and is stored by the plant in special structures. This stored CO2 is then used for photosynthesis during the day but the plant takes in no new CO2 during daytime.
The CAM plants do this so as to prevent water loss during the hot daytime hours.