The hard part to figure out isn't how. The hard part is why.
On Earth, plants and animals are pretty distinct from each other. But there's no physiological reason why you can't combine their traits. After all, the major difference between plants and animals is that plants have chloroplasts, which they use to photosynthesize. Stick some chloroplasts in an animal and give it the necessary cellular mechanisms to support them, and the animal can photosynthesize as well.
The reason why plants and animals are separate kingdoms is because getting energy from the sun and getting energy from food are two very different lifestyles. Most importantly, photosynthesis does not provide a great deal of energy, and the best way to get more energy through photosynthesis is to grow outward (exposing more surface to the sun) and upward (outgrowing other competing plants) - both of which will make moving around even harder. So plants don't bother evolving a means of active transport, since it is counterproductive for them.
An animal could gain some extra energy from photosynthesis, but it's negligible compared to the amount of energy animals can get from eating, and made even more negligible by the fact that growing in a plant-like manner (upwards and outwards) would make motion awkward. Among animals that do have a sessile, more "plant-like" lifestyle - corals and sponges - it is fairly common to form symbiotic relationships with algae, but among more mobile species it's basically pointless.
An animal might gain more benefit from photosynthesis if it was entering a state of hibernation anyway. The problem with this is that the main reason why animals hibernate in the first place is due to lack of food...and the reason why there is a lack of food in the first place is usually because the conditions are not optimal for plant growth. So there's not much point in turning into a plant yourself.
There are several animals that begin life in a mobile state and become sessile when they get older. The sessile state would then be free to grow outward like a plant, and would benefit from photosynthesis. But very few animals go from a sessile back to a mobile state - from a survival-of-the-species standpoint, it makes a lot more sense to just reproduce after reaching that state. This is especially the case if the animal grows much bigger once settling down, which would likely be the case if it was turning into a plant.
Any niche that offers an advantage to freely changing from an animal state to a plant state would likely be very situational, and is unlikely to exist for long enough to spawn a whole new class of organism. But symbiosis between existing plants and animals is somewhat easier to evolve, and it is easier to see that happening. There are some aquatic flatworms that harbor photosynthetic algae, for example.
If there were to be a hybrid plant-animal, I would expect the animal to have some kind of expandable structure that would allow it to easily expose a large surface to the sun on short notice. Many reptiles have structures like these in order to warm their blood - neck or dorsal frills, for instance. Putting down roots would be unlikely, as this would require a far more drastic physiological change, but perhaps the frill could grow bigger as conditions became more "plant-friendly". Under certain conditions (maybe after insects have eaten a large amount of plants in the area, so there is little available food but ample resources for a plant to take advantage of) the animal could burrow partially into the ground, enter a hibernation state, and adopt a plant-like lifestyle for a while. If its frill got too big, it would make active motion awkward, so perhaps it would "shed" the excess frill when changing back into animal-mode.