Convincing them to leave by choosing these dialogue options (no skill checks required):"Are you deserters?"; "I guess I can understand that."; "Why not just turn yourselves in?"; "I imagine the NCR doesn't deal with deserters kindly."; "It would be safer to run and find someplace to hide."
After bringing back order to the town of Primm, the Courier must travel to a different location and pass three days without visiting Primm. Once this is done, visit Primm's Vikki and Vance Casino. After roughly 10 seconds, the Courier will be approached by Layla and her band of thugs, who heard Primm is ripe for the picking. A conversation with Layla will reveal that they are NCR deserters driven off by the news of the Legion's increasing presence on the other side of the river, and had turned to raiding after losing all their money gambling. There are three possible ways to get rid of them:
Convince them that there is law back in Primm with a Speech skill of 30.
Pay them off with 100 caps (they will accept 50 caps if the Courier does not have 100).
Fight them.
After they are gone, the Vikki and Vance Casino will open up again and will resume functioning as a normal casino.
Notes
During conversation, Layla mentions that she and the other deserters will head to New Canaan.
Ending the quest nonviolently will cause loot in the casino to become unowned; thus taking them will not be considered stealing.