Cape Town in 2-3 days

Spend your time wisely. Check the weather service on arrival to see
which day during your stay would be the best for Table Mountain. Locals
will tell you to do Table Mountain as early in the morning as possible
to beat the wind (the first car leaves at 8am during most months, but
from 8.30am in the winter – May 1 to September 15).

Then head for the
Victoria & Alfred Waterfront with all its attractions.

Give yourself at least one of the remaining days to walk the streets of the city centre and the Bo-Kaap (High Cape).

On your remaining day decide if a trip the winelands or Cape Point is
the thing for you. Both excursions will make you want to extend your
stay.

Cape Town in a week

The same rule would apply for Table Mountain, the waterfront, the
city centre and the Bo-Kaap, but now you will have time for a day trips
to Robben Island, the winelands and Cape Point.

Spend your remaining days on a proper township tour and a day trip by train to Simonstown or a drive out to Hout Bay.

Cape Town in more than a week

Same as above, but incorporate excursions to the West Coast, the
towns of the winelands or the coastal villages along False Bay and
beyond.