All forms of iron eventually rust. Pure iron rusts very quickly and visibly, within days if not even hours. The best stainless steel can go decades before showing the first signs, but it too will eventually rust. Everything else falls somewhere in between, depending on how it has been manufactured. (And in principle, the longer you want your metal to be rust-free, the more elaborate and expensive is the processing)
Also keep in mind that rust (iron + oxygen) is just one of many types of metal corrosion (any metal + acid or other chemicals).
Stainless guitar strings that corrode very quickly, I reckon, must be pretty cheaply made and/or used in a highly damaging environment, i.e. long time spent in high humidity or near-wet conditions.
And in some cases, people with highly acidic sweat can also cause metal corrosion:
Otherwise, average guitar strings in normal, average conditions, should easily last months if not years before showing any signs of corrosion -- just go into any big guitar shop, where some of the instruments will have been sitting there for months or even years, and check the strings: even if they're cheap first mount strings and have been sitting there for a year or two, they will usually be OK.