Early Christians questioned whether the saints in heaven could sin: Origen claimed they could. Roman Catholic doctrine holds that they can due to the gift of free will. This belief is exemplified very clearly in the oral tradition of the story of pre-history.
The Roman Catholic church teaches that the Blessed Virgin Mary was, by a special grace of God, without sin her entire life. Some theologians have asserted this special grace extended to impeccability[understood in this context as the inability to sin]; others argue this could not be so, as a person she would have had free will, and therefore the ability to sin, but through her cooperation avoided it.
Impeccability is sometimes confused with infallibility, especially in discussions of papal infallibility. Impeccability is an attribute not claimed by the pope, and few would deny that there have been "bad" popes - Saint Peter himself denied Jesus three times after being essentially appointed Pope.