Often, an expiration date, "best by" date, or "sell by" date is printed on the packaging, so one need not ask. But if one is going to ask, this can be phrased in quie a few ways that will be natural.
In my experience, in the US, the term "expiration date" is much more common than "expiry date".
For food in particular, a "best by" date is also common. This means a date after which some undesirable changes may occur. The food will usually be safe past this f=date, but not in top quality much past it.
A "sell by" date is also common for food. This means that the store is not allowed to sell the product after that date, but it is calculates to that the food will still be good for several days on that date, allowing for a possible delay by the buyer in using the food. So a "sell-by" date would be earlier than the "best by" date, which in turn would be earlier than an "expiration date" Products other than food mostly use only an "expiration date" or in soem cases a "good thru" date.
Now lets consider some alternate phrasings of such a question:
"What is its expiration date?"
This is a very common way of asking about how long the product is good for.
"How long until its expiration date?"
This is a bit less common, and in my view a bit less natural, but would be clearly understood.
"How long until its shelf life elapses?"
This is unusual, and might seem a bit odd to a native US speaker, although it would be understood.
"What is its shelf life?" or "How long is its shelf life?"
This is more common than the previous version. It is not likely to be asked of comparatively short duration foods such as milk or meat, but might be used of staples such as flour or shelf-stable broth, and more likely yet of non-food items like cleaners and medication.
How long until the milk expires?
This is also a bit unusual, but would be easily understood. Such questions are mo often phrase using "when" than "how long" in my experience, and "expires" is more often used when speaking about medication or perhaps cleaning supplies than food. In those cases usually a year and month are given, not a day.
"How long until the milk is past/passes/reaches its expiry date?"
Here again a "when" quetion is more likely than a "how long" question, and "expiry date" is significantly less common than "expiration date", in my experience.
"How long is that good for?"
This is more casual than any of the options above, but reasonably common.
"When does this medicine expire?"
A very common phrasing when medicine si involved.