Are you interested in seeing the geyser and thermal areas more or the entire park or wildlife?
The park has over 300 miles of roads and travel is very very slow.
How much time to see the park?
I suppose you will be coming up thru Amarillo to Denver on I 25 and then connect to I 90 to Thompson Falls. The northern entrance to Yellowstone is about 1.5 hours from I 90 at the Livingston, MT exit.
In general I recommend 4 nights/3 full days to see Yellowstone and another 2 or 3 nights for Grand Tetons which is directly south.
I agree with PeachBelle that for the best advice we'd need to know how much time you have to devote to these parks.