In 2016 I based in both San Sebastian and Bilbao for a visit to the Basque Country. I depended totally on public transportation. I'm a slow traveler and this is how I used my time:
Bilbao: 4 nights. Side trips to Bermeo (raining, so that was a quick visit) and Vitoria-Gasteiz (full day--it has a large walkable medieval center and several museums). I really liked Bilbao's non-touristy Casco Viejo (historic center), the city's architecture in general and of course the Guggenheim.
San Sebastian: 4 nights. Side trips to Zumaia/Getaria/Zarautz and Hondarribia. I'm not into the pintxo-bar scene that totally dominates San Sebastian's historic quarter, but it's a pretty city.
Bus travel is usually recommended between Bilbao and San Sebastian, because the Euskotren is very slow, but the scenery along the train route is very nice if you have extra time.
There was an art museum I'd have liked to see that was closed in both Bilbao and San Sebastian, or I'd have wanted another day in both places. It would also have been nice to see Lekeitio and Gernika.
There are lots of interesting places in the French Basque Country, too, but it sounds as if you don't anticipate spending time there on this trip. Many people traveling in the direction you are would want to spend substantial time in the Dordogne/Lot area east of Bordeaux.
The Search function here will turn up quite a lot of earlier threads on this topic, with suggestions for additional destinations.