Stigmata can have three origins- divine, diabolical and purely human. Some people purposely hurt themselves so as to appear to have the stigmata, or else it comes through psychosomatically. These kinds of wounds show themselves to be false right away.
Still others have diabolical origins. For example, Magdalena de la Cruz in the fifteenth century was reported to have the stigmata on and off for thirty-nine years. She was eventually exposed and confessed to have made a compact with the devil in exchange for superficial supernatural gifts. She was indirectly the cause of much suffering for St. Teresa of Avila, for Teresa’s confessors were afraid of her spiritual experiences as coming from the devil just like Magdalena’s. Some ways to identify false stigmata: the wounds are very transient- lasting for only brief intervals; the wounds are superficial and blood is often more murky; there is a lack of the other extraordinary gifts associated with a stigmatist; the false stigmatist has a tendency to show off the wounds; the wounds do not appear to cause much pain; the wounds may vanish under hyponosis or autosuggestion; the wounds never puncture all the way through the limbs; psychological hysterical symptoms are evident; the wounds can be treated with medicine; the false stigmatic has a superficial spirituality.
Finally, there is a divine origin. Authentic stigmata are deep- all the way through the limbs; come on through a rapture or ecstasy; subject to severe bleeding; wounds appear fresh and are bright red in color; often have a sweet odor; they occur spontaneously; the blood flowing through the wounds often goes against the laws of gravity; wounds tend to appear in the place where skin is thickest and most resistant; and intense pain characterizes these wounds. (All this information can be found in "They Bore the Wounds of Christ, by Michael Freze).
Padre Pio is the first priest to have had the stigmata, and as far as I know, the only one so far. Some people think that St. Paul was actually the first person to have the stigmata- but obviously we do not know that for sure.
The bottom line is that stigmata is in no way a factor in considering someone’s sanctity. This is usually ignored and the person’s virtues are what are examined- their humility, patience, charity, etc. Supernatural gifts are just the ‘icing on the cake’ so to speak. In a saint like Padre Pio, they are present for us to marvel at the greatness of God, who can work wonders with the most humblest of people.
Whether the stigmata is truly of divine, diabolic or human origins within a person is something that simply will reveal itself in time.