What can I substitute for Gruyère in quiche lorràine?
There are a couple variations that if you're lucky might be cheaper: Beaufort and Comté. (I've only actually tried Comté, but I've seen Beaufort listed along with it and Gruyère.)

A bit farther away are Emmentaler and Jarlsberg. They both have the Swiss cheese flavor but aren't quite as firm nicely aged. Beyond that there's simply all the varieties of (American) Swiss cheese, which are generally roughly like Emmanteler but likely even softer.

If you use one of the farther away substitutes, I'd suggest adding in some hard aged cheese as well to make up for the difference. For example, I've used (American) Swiss cheese plus dry jack and parmesan and been pretty happy with it. The specific hard aged cheese probably doesn't matter a whole lot, as long as it has some nice aged flavor and not a lot of overpowering other flavors.