How do we get used to smells? 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:


  Habituation is a decrease in an elicited behavior resulting from the repeated presentation of an eliciting stimulus (a simple form of learning.


More specifically, it's technically called Neural adaptation. To quote Wikipedia again:


  Neural adaptation or sensory adaptation is a change over time in the responsiveness of the sensory system to a constant stimulus. It is usually experienced as a change in the stimulus. For example, if one rests one's hand on a table, one immediately feels the table's surface on one's skin. Within a few seconds, however, one ceases to feel the table's surface. The sensory neurons stimulated by the table's surface respond immediately, but then respond less and less until they may not respond at all; this is neural adaptation


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.