There are many lodging options near Yellowstone. Your choice will depend on your personal preference and how far you wish to drive to see the sights you wish to visit in Yellowstone.
West Yellowstone, Montana offers the greatest number of hotel rooms and cabins, Cooke City / Silver Gate, Montana the least.
Gardiner is close to the north entrance of Yellowstone, but does not have as many rooms as does West Yellowstone.
Cody, Wyoming (to the east) and Jackson, Wyoming (south) are each about an hour from Yellowstone.