To be in heaven means to be in the immediate presence of God (the beatific vision) and renders a person incapable of sinning. This doesn’t mean a person doesn’t have free will; he is free to do all that he is capable of doing. But someone in heaven is no more able to sin than you or I are able to fly by flapping our arms. This means that neither the angels nor the saints in heaven sin, and so it is not necessary to pray for them.
Because it is not possible to sin while experiencing the beatific vision, the Church teaches that there must have been a time when the angels did not experience the beatific vision and were given a test, similar to the test given the first humans. The nature of the test given to the angels is not known, but the angels who chose God were granted the beatific vision; the angels who chose self over God fell, as did Lucifer.