The best time to visit Yellowstone National Park is in the spring or summer months when it's usually warm enough to sleep outside or be outside.
I recommend taking a camper trailer to stay in because of the Bison although they usually will not bother you as long as you leave them alone.
I find it more comfortable to sleep indoors in a camper trailer than in a tent on the ground but some people enjoy sleeping in tents which is also a good experience for some people.
During July and August are the best months to visit Yellowstone National Park which is the most popular time as kids are out of school which makes it a great trip time.
However sometimes it can get down into the 30 F degree temp range at night even in summer in Yellowstone so be prepared for that.
That's one reason I prefer sleeping in my camper trailer in Yellowstone at an RV park as it's well worth the cost.