What are some circumstances that would require a mammal or a reptile to grow another pair of limbs?
While structures can change over time due to evolutionary adaption (fins become legs become wings, for example) the critical thing is the new structure must be adapted from some already existing structure. The inner ears of modern land dwelling creatures can be traced back to the bones used to support gills in fish, for example.
Since land dwelling creatures can trace their lineage to a fish many millions of years ago, all the structures on modern humans, giraffes, komodo dragons, frogs, kangaroos etc. can all eventually be traced back to basic fish architecture. There is literally nothing for an extra set of limbs to evolve from. Things can devolve through lack of use; cats no longer have collar bones, and there are plenty of creatures who have lost eyes from living for thousands of generations underground, so it may be plausible to envision creatures losing sets of limbs (whales and dolphins no longer have rear legs, and there is only a vestigial pelvis left) rather than evolving extra limbs.
Now if a new set of creatures were to be postulated who do not have an ancestral fish in their evolutionary history, then there may be scope for limbs or other structures to evolve in and out of a creatures evolutionary history (ants are closely related to bees and wasps, for example, but for the most part have devolved wings. It may be possible for them to be forced by evolutionary pressure to bring back wings, the basic genes and structures are still hidden away, waiting for reuse).
So for a mammal or reptile, the answer is no. If you rewind evolutionary history back to the Cambrian, when there were many more body plans, you might be able to arrange things so a much different creature becomes the basis for modern land dwelling creatures, although now we are dealing with alt history.
Others have pointed out how vertebrete development got locked in before diversity, so it can’t accomodate a change to the basic plan with some simple mutation in a high-level routine, because it would break everything.
But… there are cases of parasitic twins and conjoined twins, a single biological entity with extra (working) limbs.
Development could split at an early stage like that, but become refined and perfected in the genome.
That would require a mutation to promote monozygotic twinning, in an environment where that confired advantages. Then, errors in the twinning would occur, without negating the overall advantage and occasionally the conjoined organism would be successful for some reason or the cause is a side effect of something else that is beneficial.
Upon reading the question, I immediately thought of James Cameron's Avatar, wherein nearly every animal has six limbs.
Here on Earth, primates have two proper arms, but opposable toes on their feet enable their legs to act as a second pair of arms, which shows that having four branch-grabbing appendages is obviously a useful feature, otherwise they would not have evolved.
The four "arms" of primates increase speed and range of movement within forest canopies, the article on Prolemuris even goes as far as to state that
The prolemuris can use its four arms to move through the trees faster than an average man can run.
Whilst for primates here on Earth, opposable toes gave them an extra limb to navigate trees, having hands instead of feet will decrease speed and balance when traversing open land.
However, the prolemuris need not face this problem: its four arms mean it still traverses tree-tops with incredible speed, and having feet means it can probably balance and coordinate its movements on the ground as well.
Even if its feet (which they might be) are pretty much another set of hands, it means that it will navigate trees even faster: swinging from hand to hand, to foot, to hand, to foot, back to hand etc.
And, as the image shows, it can use two of its arms for extra tasks as the others move it around the canopy.
However, a system like this is not likely to evolve here on Earth, as the current 4-limbed system of monkeys traversing their tree-top homes is good enough that a hexapodal primate will probably never evolve.
That doesn't mean, however, that on alien planets hexapoda will never evolve to traverse both ground and trees as the prolemuris.
There are still other fantastical creatures which exhibit four arms, I remember during my childhood seeing two-such creatures, Ben 10's four-arms alien, and Gormiti's kolossus.
When I first saw kolossus, my thought process was literally: "Woah! That's insane!"
It's because I'd never-before seen a four-armed creature where the first pair and second pair of arms were one after the other, along the shoulder line.
Instead I had been habituated to seeing only four-armed structures where the first was above the second, as in four-arms.
However, lets compare how these different anatomies would fare in certain situations, thus seeing what might cause each of them to evolve.
I remember from the T.V. series that four-arms was an alien designed for fighting: he had incredible strength and stamina, and would utilise his four arms to create shockwaves after clapping them together.
Of course, I doubt any being would be strong enough to topple enemies with shockwaves, but the benefit of having four arms to increase one's fighting capacity is obvious: you can get in more punches, more hits, you can block more attacks than otherwise, pretty much stop all of your foe's movement by holding each of their limbs in one hand; a creature designed for melee combat.
Kolossus, on the other hand, would not be as effective a fighter: his rear-most arms would not easily be able to hit his foe. However, his arms seem set up almost like a platform, and he would be able to support massive amounts of weight.
I remember that kolossus was part of an earth-tribe of Gormiti, and that they lived underground digging tunnels; he may have supported the tunnels for his allies, keeping the roof from collapsing as the tunnels were worked on.
However, I see no real reason why this adaptation would evolve naturally in a single species, so, cool as it may look, kolossus' four-armed structure is pretty much useless.
Really, prolemuris seems to be the most likely way that a four-armed evolutionary tree may start, but from then on, creatures such as four-arms might start showing up, if the planet is very violent with inter-species feuds (much like the human race.)
In general, evolution doesn't add new body structures, only modifies existing ones, and the more complex an organism is, the harder it is for a limb-adding mutation to work. While there are occasional vertebrate mutants with extra limbs, those limbs are typically deformed or non-functional, and would not add any benefit.
However, there may be other, more creative routes one might take, turning something that wasn't a limb before into one. Who would have thought that a nose could be used for grasping? And yet, we have the elephant.
The split lip of rabbits is an adaptation that allows them to grasp their food better. What if some rabbits started eating smaller animals, and their mouths split further apart, with the split halves gaining extra protuberances to capture prey more effectively, eventually turning into specialized grasping limbs? Sounds far-fetched? Well, that's basically what scorpions did - those claws are actually giant pedipalps, which are mouthparts in other arachnids.
Hands and fingers could also be fun to speculate on. Picture a tree-dweller that gains longer fingers and more flexible finger joints, allowing it to grasp multiple branches at once, either through prehensile motion (like monkeys) or claws (like squirrels and cats). Eventually, each finger begins to function like an individual arm. The main arms might get shorter, and the animal might at some point return to a ground-dwelling lifestyle, now scuttling around on up to ten single-toed legs (or even twenty if you want to include toes as well).
While scorpion bunnies and squirrel-crabs might not be what you're looking for, once the basic body plan exists it's only a matter of time and necessity before it can diversify further.
Its not impossible it is however incredibly unlikely, requiring a series of unlikely events and at least one mass extinction.
Your big problem is that if the hox genes responsible for limbs get duplicated they interfere with each other. The genes that form the limbs are separate from the ones that connect the limbs to the spine, so you end up with multiple limbs trying to share the same joint, which prevents any of them from working well. This is what we see in animals born with extra limbs now. Forming extra limbs is just a matter of triggering apoptosis at the right point on a forming limb bud, getting limbs that can function and differentiate are much trickier.
So the only way to get it to happen is to have an reptile or mammal in which the limbs in question do not matter, where they are not used anyway or the function is extremely limited. Of course under those conditions the functionality of the limbs will also start to decline since they are then un-need tissue. Some kind of long aquatic reptile might be your best bet where the extra limbs don't need to have a separate joint just be stiff enough to function as a defacto flipper, the two limbs giving it a wider flipper. This means it should also give live birth, since coming out on land to lay eggs will not work well.
It then has to change lifestyle so movability and use of the limbs becomes important again. Say by moving into swamps where grasping limbs become helpful again. basically you want to mirror the original development of limbs from fins again, this is why you need a mass extinction, this animal cannot have to much competition. It will also help if the animal is on an isolated land mass like australia where competition after the extinction will stay limited for a long time. there are plenty of existing animals that fit these niches or are close to them, you need to get rid of on at least one land mass.
One thing you will see is the the two limbs will still share a basal joint so to get them to work the joint itself will have to be heavily modified but still contiguous. So if the are the for limbs they will share a shoulder joint, if hind limbs they will share a hip joint.