Despite the term, mosquitoes don't actually bite. They pierce the skin to get at the blood just beneath it. That red, itchy bump that appears is the body's allergic reaction, and not the result of a tiny wound. Only female mosquitoes bite.
The way it works is that a mosquito uses heat sensors on its antennae and around its mouthparts to locate capillaries near the skin's surface. The mosquito has a proboscis - a long, pointed mouthpart - and inserts that to tap the capillary.
There are two tubes in the proboscis. The mosquito uses one to inject saliva, while the other draws in blood. The saliva contains enzymes that serve two purposes: act as a mild painkiller, so the prey doesn't notice, and thin the blood so that it does not clot and keeps flowing.