Both black and green tea is harvested from an evergreen, tree-like shrub known as camellia sinensis. Most likely originating in China, the camellia sinensis is thought to have first been used to brew a medicinal elixir during the Shang Dynasty (1600 BC to 1046 BC). By the Qin Dynasty in the third century BC, it had become a relatively popular drink using only the leaves from this plant, rather than mixed with other things as seems to have been common when used medicinally.
The difference between these teas is achieved via different processing methods. Manufacturers create green tea by picking the leaves off the plant and then heating them immediately afterwards. This is commonly done by pan firing the leaves or steaming them. Sufficient heat stops the leaves from oxidizing, allowing them to maintain their green color.
Leaves that are going to be used for black tea are allowed to ferment, or oxidize, completely. The general process here is to roll, tear, or crush the leaves to help along the oxidation process (similar to why the inside of an apple turns brown when you expose it to air). The leaves are then dried out, sometimes in the Sun or otherwise using machines. As the leaves oxidize, they gradually turn from green to black.