Boil the potatoes until they are fork-tender. Strain and let cool. In a small bowl combine the onions, mayonnaise, sugar, and vinegar. Put the potatoes in a large bowl and add the apples and mayonnaise mixture. Fold all of the ingredients together and let chill in the refrigerator for at least 2 hours.