We number our fingers so that we know which finger goes on which note. The numbering system is simple: thumbs are #1...pinkies are #5. Take a look at the graphic below to see the fingering layout.
When we apply a set finger pattern to a section of music, we call this our fingering. Passages of music usually have set finger patterns because that fingering has worked for most people. For instance, if the music went from middle ‘C’ to ‘G’, you would most likely use 1 & 5 when playing with your right hand. Now, that is not to say that you can not use your thumb and ring finger, or 1 & 4. When you see a finger number written in the music, it is merely saying “Hey, this fingering works!” You’re free to change the fingering as you see fit.