Opened ayran, with the cap screwed on tight, should be finished within 3-4 days in the fridge; homemade ayran has a shorter life than the store-bought kind and is best finished within 2 days.
Kefir is naturally a bit more prone to souring than ayran; once opened it keeps for about 5-7 days in the fridge, but it gets more sour by the day, so drinking it earlier keeps the flavor more balanced.
Why does souring speed up?
Both drinks are fermented dairy products, so the microorganisms in them keep working slowly even in the fridge; that's why there's a noticeable gap between how they taste on day one and on day four or five. In a cold fridge, that process moves far more slowly than it would at room temperature.
Closing the bottle quickly every time it's opened cuts down the surface exposed to air and delays souring a bit; transferring what's needed into a small container instead of leaving a large bottle open for a long stretch gives a better result.
Can they be frozen?
Frozen ayran breaks down once thawed, with the milk and water separating, and it stops being pleasant to drink; freezing isn't a method worth recommending here. Kefir behaves similarly, losing its texture and turning watery once frozen and thawed.
Rather than freezing leftover ayran or kefir, it can be worked into a yogurt-based soup or a baked dish, which uses it up without any waste.
Is it different for homemade ayran and kefir?
Homemade ayran keeps for less time than the pasteurized kind bought at the store, since its microorganisms are still active; that makes it more sensible to make just enough for a few days rather than a big batch.
Kefir cultured at home is a living culture kept going with its own grains; unused kefir grains can sit in a separate container with a bit of milk in the fridge, ready for the next batch.
A thin layer of foam building up in the bottle is a normal sign that fermentation is still active in both ayran and kefir; but if that foam comes with a sharp, off-putting smell, the drink shouldn't be consumed.
If ayran isn't shaken before drinking, a bit of foam can sit on top with a slightly thicker layer below; that's just the ingredients settling naturally, and shaking it before drinking is enough.
Kefir left in the fridge for a longer stretch can separate a lighter liquid, whey, on top; that isn't spoilage either, and stirring it back in before drinking is fine.
Keeping an ayran or kefir bottle on an interior shelf rather than in the door means less temperature swing, which slows the souring process down a bit.
Homemade kefir can be slightly fizzy and foamy in its first few days; that's normal, and that liveliness fades a bit over time, with the flavor mellowing along with it.
Both ayran and kefir have a limited life once opened; keeping the cap tight and drinking them sooner rather than later is the key to getting the best flavor from both.