Fingerprints are one of those bizarre twists of nature. Human beings happen to have built-in, easily accessible identity cards. You have a unique design, which represents you alone. People have tiny ridges of skin on their fingers because this particular adaptation was extremely advantageous to the ancestors of the human species. The pattern of ridges on fingers make it easier for the hands to grip things, in the same way a rubber tread pattern helps a tire grip the road.
Like everything in the human body, these ridges form through a combination of genetic and environmental factors. The genetic code in DNA gives general orders on the way skin should form in a developing fetus, but the specific way it forms is a result of random events (this is why all fingerprints are different). The exact position of the fetus in the womb at a particular moment and the exact composition and density of surrounding amniotic fluid decides how every individual ridge will form.
The fingerprint is more genetic than enviornmental, however. Identical twins have nearly if not completely identical fingerprints.
Chris has a point though. Most traits in an organism is dependant on both enviornmental and genetic factors. Geneticists usually assign ratios to this. For example being right- or left-handed is about 25% genetic and 75% enviornmental.