I do not know if sunlight causes ink to fade
faster when printed in books or in magazines. The
best way to find out is to test it yourself! You
can easily run an experiment where you expose a
page of a book and a page of a magazine to
sunlight for the same amount of time. Then, check
to see which one has faded more.
I think many things can affect the answer. For
example, the material that the ink is made of
and the color of the ink probably matter. The
temperature and humidity in the area probably
matter, too. These factors will make it hard to
say in general which will fade more.