Atomic radius is the distance from the nucleus to the outermost electron shell of an atom. It generally decreases across a period (row) in the periodic table from left to right, and increases down a group (column). This is because the effective nuclear charge (the net positive charge experienced by the electrons) increases across a period and decreases down a group. The stronger the effective nuclear charge, the more strongly the electrons are attracted to the nucleus, and the smaller the atomic radius.
In the case of carbon and oxygen, oxygen has a larger atomic radius because it has more protons in its nucleus (8 protons) than carbon (6 protons). The increased number of protons in oxygen results in a stronger effective nuclear charge, which pulls the electrons in more tightly and reduces the atomic radius.