How do we get used to smells?
For example, you walk into a room with a certain stench, but it seems no matter how strong it may be, spending enough time in the room will allow you to stop smelling it.
What's going on here?
As Ben Brocka mentioned, what you're describing is Habituation, which Wikipedia defines as:
More specifically, it's technically called Neural adaptation. To quote Wikipedia again:
As this was explained to me in Psychology 101, this is the same phenomenon which allows us to not feel our shoes shortly after putting them on. It's also what enables people to perform really dirty, smelly jobs like sewer maintenance and garbage collection.
The process works exactly as you described, and many people can instantly relate to it: The longer you are exposed to a given stimulus (like a smell) the less you continue to react to the stimulus. The stimulus becomes more "normal" to you, and you start to think of it less. As soon as the stimulus is removed, the effect begins to reverse. The Characteristics of Habituation section of the Wikipedia article covers this.