No, it's not defined by the rules.
Aside from a few exceptions here and there, there is no definition on how a character obtain (cosmetic) scars from combat, or if magical healing does anything to them.
The Skulls&Shackles adventure path introduces an optional table for scars and wounds caused by badly wounded characters, with a 25% possibility of cosmetic scars and 75% possibility of scars with penalties, which are very light to be honest (lose an arm and take -1 str and cannot use two-handed weapons). The rules for those can be found on the sidebar of the Combat Page on SRD.
If not using that optional rule, nor Regenerate nor Cure Wounds spells seems to mention anything about scars.
Other than that, what happens is left open for each particular GM to rule however they want, on the paizo's forums, people have created their own sets of house rules to treat scars and removing them:
The general consensus on those topics is that natural healing leaves scars, and magical healing doesn't. Personally, on my tables you get a scar everytime you get critically hit, and no matter how it was healed, it will leave a (cosmetic) scar.
But if i were to adopt the house rule from the community, i would also change that if you recieve Long-Term Care you wouldnt get scars, as you are recieving proper treatment to your wounds. But if you got Badly Wounded and Treated, it would leave scars.
By the definition of scars on wikipedia, it seems related mostly to natural healing. With an exception for creatures with regeneration.
Thus, scarring is a natural part of the healing process. With the exception of very minor lesions, every wound (e.g., after accident, disease, or surgery) results in some degree of scarring. An exception to this are animals with complete regeneration, which regrow tissue without scar formation.
So, healing obtained from Fast Healing should leave scars, as "fast healing is just like natural healing". While those healed by Regeneration shouldnt, even though it states that works like fast healing with additional exceptions.
Cure Wounds spells channel positive energy to heal wounds, which unlike Celestial and Infernal Healing, does not affect the creature's natural healing at a quickened rate due to the fast healing effect granted by those spells.
For the sake of this answer, i will a small list of spells, effects, feats and abilities (from paizo) that say how a character can obtain scars by the rules:
Also, the rules for Called Shots will cause temporary and permanent wounds on a character, which could or not leave scars (again, at GM Discretion).