This is a classic old wives tale. It is so common that one could almost consider Snopes the final authority on this, but let's actually dig into it a bit more.
Ohio State University says false:
Q: Is it true that swallowed gum stays in your stomach for 7 years?
A: This myth is definitely false. The body is very good at digesting material that it can use and passing the rest out in the stool. It is true that your body is unable to digest the synthetic portion of chewing gum, but it doesn't stay in the stomach for an extended period of time because the stomach periodically empties into the small intestine. The gum then moves through the small intestine into the colon and is eventually passed in the stool.
NYU Medical school tackles this a bit differently, listing both points for and against the myth, but they conclude with:
Documentation of intestinal blockages due to chewing gum seem to point only to a danger in swallowing excessive amounts of chewing gum repeatedly, as opposed to swallowing a single piece occasionally. Although the gum base itself is indigestible, a small piece of chewing gum can pass easily through the digestive tract in the same time it would take digestive waste to travel the same path and be eliminated.
The seven-year myth may have sprung from a misconception of gum’s digestibility based on the look and feel of gum. After all, it doesn’t dissolve in your mouth like other foods. Or, maybe it was mom’s clever way of scaring you into not swallowing your gum and freeing up your mouth for another piece!
The same type of refutation of this myth are common throughout the Internet.
So as to your other questions:
Is your stomach really unable to digest gum?
The previous articles addressed this. Basically there are compounds that are not digestible, but they just pass through your system much like any other material one can't digest. There is always the classic story of some toddler or animal eating an expensive piece of jewelry, and everyone examining feces for a few days until it's recovered.
Will undigested food really stay in your stomach?
No, as previously mentioned.
If so, is there something special about 7 years?
It sounds authoritative. And the number seven seems to be associated with a lot of things in western culture. 7 year itch. Lucky 7. Seven deadly sins. Why not add another thing that uses the number.