Almaty sits at roughly 800 metres in a bowl at the foot of the Trans-Ili Alatau, and within about an hour of the last apartment block the ground has climbed past 3,000. That single fact decides both how long the city is worth and what order to do it in. The flat part — the parks, the bazaar, the long promenade, an afternoon that turns into a four-hour lunch — is a solid two days. The wall of mountains behind it is worth three more. But the mountain days are the ones you cannot book in advance, because a ridge that is clean at nine in the morning can be inside cloud by one, and a road to a lake at 2,500 metres closes when the weather says so rather than when your itinerary says so.
So the answer is five days, and the useful part of the answer is the shape: two of those days planned, three of them deliberately left unassigned and sorted the evening before. Travellers who arrive with a rigid grid tend to lose one of the five to a cable car ride into grey, and then spend the rest of the week being told by everyone they meet what the view is normally like.
Why the order is decided by the sky and not by the map
Almaty is unusual in that its finest days and its most reliable days are different days. The city-level sights work in any weather: a bazaar is a bazaar in the rain, and the Kasteyev art museum is an excellent place to be when the cloud is down. The mountain days are the reverse — they are the reason to come and they are entirely at the mercy of a forecast that changes fast at altitude.
Treat the two city days as ballast. They are what you spend a bad day on, which means you should not spend a good one on them. Every morning you look at the mountains from wherever you are staying; if the peaks are visible, that is a mountain day, and the bazaar waits. This sounds obvious written down, and it is remarkable how few people do it.
Two smaller constraints sit on top of the weather. The Green Bazaar closes on Mondays for cleaning, so a Monday is never a market morning. And Medeu, Shymbulak and the road to Big Almaty Lake fill with Almaty's own families at weekends — locals will tell you plainly to avoid Saturday and Sunday up there — so if your week contains a clear Tuesday and a clear Sunday, the Tuesday is the one to spend at altitude.