We went a few years ago just to see the fountains (we had been years ago to the Chateau and actually went again with friends a couple of years ago). There was zero line for the gardens; you just buy tickets on arrival at the garden entrance. When we went to the chateau on our last trip we added the gardens last minute; the line that time was maybe 15 people ahead of us -- so no big deal. I suspect if we had gone around to the side entrance we had used before, there would have again been no line.
The tickets are good all day. so you can do the morning fountains leave the gardens for lunch and to visit the Trianon and Hameau etc and then return for the afternoon fountains (they run fr 90 minute or so in the morning. and then they run again for a couple of hours in late afternoon). Because they run so briefly I would try to get there for the early fountains so you can do both sessions. Not all fountains run at all times.
Here was our experience.:
https://janettravels.wordpress.com/2016/02/15/fountains-of-versailles-a-little-chaos/