While steps have been taken in other National Parks to limit visitation, the National Parks Service does not limit the number of visitors to Yellowstone and Glacier. All camping is limited to 14 days between June 15 and Labor Day, and to 30 days the rest of the year. Honestly, this question depends on the kind of experience you are hoping for. Allow extra time is for a good look at all the park has to offer, including wildlife viewing, hiking, biking, rafting, camping. Many historical sites, shopping areas, and other great Montana attractions are within easy driving distance of the parks.
Glacier is open all year round.
Going to the Sun Highway opens when weather permits. Campsites can be reserved in both parks with certain limitations. Glacier Park and Yellowstone Park both have numerous lodging alternatives within easy driving distance of each park. Glacier Park visitors can stay the night in the towns of West Glacier, East Glacier, Essex, Browning, Kalispell, Columbia Falls, Whitefish, and in many other cities within a 30-45 minute drive. Yellowstone Park visitors can stay in West Yellowstone, Big Sky, Mammoth Hot Springs, Pray, Cooke City, and several other cities within the same 30-45 minute distance.