The quick answer is that we have fingers and toes because our ancestors have them and because they are useful for walking and grapping objects.
The earliest land animals that moved out of water and onto land had various numbers of toes (and/or fingers) which they needed to support their weight. Over time, the five toed creatures established the ancestral (primitive) pattern for all land dwelling vertebrates.
Humans belong to the group called primates, a group of animals that was initially adapted to living in trees. Our body design is determined by our evolutionary ancestry. All primates have 5 fingers on each hand. The first finger is actually called a thumb. The thumb is separated from the other fingers. This allows the thumb to be brought into opposition with the other fingers. An opposable thumb improves the ability of primates to securely grasp objects in their hands. It also enabled us and other primates to develop tools.We have toes because our ancestors had toes. Human toes have become shorter and more adapted to running on the ground. This adaptation was of advantage because running on the ground was more important to the early human than was climbing in the trees.
The bones in the finger are called phalanges. Fingers 2-4 are made up of three phalanges; the thumb has two phalanges.