CCD
Charge coupled devices, or CCDs, are sensitive detectors of photons that can be used in telescopes instead of film or photographic plates to produce images. CCDs were invented in the late 1960s and are now used in digital cameras, photocopiers and many other devices. Its inventors, Willard Boyle and George E. Smith received the Nobel Prize in physics in 2009 for their work.
A CCD is a tiny microchip onto which the light that the telescope collects is focused. The microchip consists of a large grid of individual light sensing elements called pixels. Each pixel is very small, about a 10 micrometer(µm) square printed on a cracker sized piece of silicon ~50µm thick. Tissue paper is about the same thickness. The images below are of astronomical CCDs from one of LCO's telescopes and show the front and back of a CCD.

Image credit: LCO
When light falls onto one of the pixels, electrons are released from atoms in the pixel. To measure the amount of light that fell onto each pixel, the number of electrons that was released has to be counted. This is done by measuring the charge on the pixel at the end of the last row in the grid. Then that charge is discarded and all the other charges in the row are made to move along to that one corner pixel. The next charge in line is then measured, and so on – until all the charges in that row have been dealt with. Then all the charges in all the remaining rows are made to move over one row, and the whole process is repeated. Amazingly, the entire chip can be "read" in less than 10 seconds. It is this method of read out that distinguishes CCDs from other devices (such as photodiodes and CMOS devices) that convert photons to electrons.
CCDs are increadibly powerful tools for astronomers because when a telescope's motion is synchronized with the Earth's rotation, the camera can “stare” at one spot in space for hours at a time. The longer the CCD is exposed to the sky, the more photons will land on it, and fainter, more distant objects can be imaged than are otherwise visible. CCD exposures are so long in astronomy (seconds, minutes or even longer) compared to digital cameras (normally a fraction of a second), that CCDs in telescopes are usually kept very cold (−50°C to -100°C). Keeping the CCD at a very low temperature minimizes the effects of thermal noise. At any given temperature, a certain fraction of the electrons in the atoms of the CCD itself will have enough thermal energy to liberate themselves. They are then indistinguishable from electrons liberated by the interaction of the CCD with incoming photons from the telescope, so they get counted as if they were light from a star.
CMOS
A CMOS device is a complementary metal-oxide-semiconductor (CMOS) active-pixel sensor. CMOS devices are used in digital cameras such as mobile phone cameras, webcams, and DSLR cameras. A CMOS device contains an array of individual photodiodes called pixels etched into the silicon chip, and transistors to amplify the signal from each individual pixel. They combine both the image sensor and image processing functions in an integrated circuit.

CCD readout compared to CMOS. Photon to electron conversion happens at each pixel. For a CCD, the electron charge is then passed along the line of pixels and converted to a voltage at an output node at the end of each line. In contrast, for a CMOS device, the electron charge is converted to a voltage at each individual pixel. Image credit: Stefano Meroli, Engineer at CERN
For ground-based astronomy, CCDs have been the most used technology. However, CMOS technology has improved with the advances in lithography technology improving the optical sensitivity.