Claude Gellée was born in the Duchy of Lorrain and is thus usually known as Claude Lorrain, but he lived and worked most of his life in Rome. He was far more a landscape than a history painter, he often hired other painters to add the figures and told his customers that he was selling them only the landscape, the figures were complimentary. As a landscape painter, he was often considered unmatched.
The subject of this 1645 painting is rather obscure, it has been done a few times, always as an excuse for a landscape: Apollo Guarding the Herds of Admetus and Mercury Stealing them. Apollo was once sentenced to a year of servitude to a mortal by the other gods, and he chose to become the herdsman of Admetus, King of Pherae in Thessaly, renowned for his hospitality and justice.
Where the side story of Mercury stealing the herds and later returning them (a drawing by Claude Lorrain of Mercury returning the herds was auctioned at Christie’s in 2003) comes from I have no idea. It seems to belong to the story of Apollo and Daphne rather, not to the Admetus story. At the time, mythology was maybe taken a bit too serious.