Meaning of the Verse
Allah commanded the Prophet ﷺ to address sinners as Ya ibadi, O My servants; calling them His servants despite their sins is itself a sign of mercy. Asrafu ala anfusihim means those who wronged themselves by committing sins. They are told not to despair of Allah's mercy, because He forgives all sins, even major sins such as shirk (associating partners with Allah), murder or zina (unlawful sexual relations).
According to our tafsirs, this forgiveness is for the one who repents sincerely, and the next verse, Wa anibu ila rabbikum wa aslimu lah, explains this: turn to your Lord and submit to Him before the punishment comes. So this verse is not an excuse to be bold in sinning; it is a call to leave sin and return.
Occasion of Revelation
In Sahih al-Bukhari and Sahih Muslim, Ibn Abbas (may Allah be pleased with them both) relates that some polytheists had committed much killing and much zina. They said to the Prophet ﷺ: What you invite to is very good; if only you would tell us whether there is any expiation for our past sins. Upon this, verse 68 of Surah Al-Furqan and this verse were revealed.
In al-Sunan al-Kubra of al-Bayhaqi and al-Mustadrak of al-Hakim there is a narration from Umar (may Allah be pleased with him) that some Companions thought that the repentance of a person who had turned back from the religion under persecution would not be accepted. Then this verse was revealed, and Umar wrote it down and sent it to Hisham ibn al-As (may Allah be pleased with him), upon which he emigrated and joined the Prophet ﷺ.
This Verse in the Eyes of the Companions
Abdullah ibn Mas'ud (may Allah be pleased with him) passed by a preacher who was frightening people and said: O admonisher, do not make people despair, and then recited this very verse. It is reported from Abdullah ibn Amr (may Allah be pleased with them both) that in his view this is the most hope-giving verse in the Book of Allah.
In one narration, Thawban (may Allah be pleased with him) reports that the Prophet ﷺ said: I would not like to have the world and all that is in it in exchange for this verse. This narration is well known, but the hadith scholars differ about its chain, so it is not presented as a certain virtue.
Key Lessons
Despairing of Allah's mercy is itself a major sin, and no sin is so great that it cannot be forgiven after sincere repentance. A caller to Islam and a preacher should give people hope as well as warn them. However, the door of repentance is open only until death or punishment arrives, so hope requires turning back at once and not delaying repentance. No specific wazifa (set recitation) or number is proven for this verse; the real practice is seeking forgiveness and leaving sin.