The Taj Mahal is a dynamic image with different beauty as the sunlight alters its color during the day, so technically you can make a visit any time of the day.
However, sunrise is the best time as the monument is like a blooming flower when the twilight gilds it with pink color. Moreover, if you visit the Taj Mahal in the early morning, you can not only avoid the heat but also the crowds. For those people in pursuit of some perfect shots and don’t want to wait too long, getting up earlier can be very rewarding.
If you are not a morning person, a sunset visit is also a nice choice. The temperature becomes cool after the scorching afternoon and the monument is surrounded by soft silver light. Usually, there are more visitors at sunset than sunrise. Patience is necessary to capture some good pictures.
If you happen to be in Agra on the full moon day or 2 days before/after, a night visit to the Taj Mahal is also available. Unlike what you see in the daytime, the silhouette of the structure against the dark sky and moonlight is full of peace and magic.