When can spoilers be used on airliners?
Spoilers have many uses, but first I want to distinguish types of spoilers.  Airplanes will typically have ground spoilers and flight spoilers and they work like they sound.

Ground spoilers only open up on the ground -- these are usually much more detrimental to lift than the flight spoilers.
Flight spoilers open when actuated by the pilots

Another type of spoiler is the spoileron, which is used on some airplanes like an aileron, that is to bank the airplane by destroying lift on one wing.
Since you ask about use in the air, I will focus on flight spoilers.  When would I use flight spoilers?

I want to descend faster
I want to slow down quicker
I want to descend and slow down

I want to descend faster
This can be broken down into three categories

I screwed up and I need to make a crossing restriction
The anti/ice system turned on (more on this below)
I am initiating an emergency descent (abnormal)

The bit about a/ice comes from the fact that on many airplanes when a/ice is on there is a high demand for bleed air.  In the EMB-145 the FADEC bumps up idle thrust quite a bit to meet this demand and if you did not anticipate this in your descent planning, we were authorized to use our spoilers in icing conditions to aid in the descent.  This could be interpreted as an &quot;I screwed up&quot; case, but really isn't in my opinion.
I want to slow down faster
If there is a charted speed restriction, this may be useful.  Particularly if you have just prioritized the descent to meet a crossing restriction and now need to bleed off speed.
You might need to start descending out of 10k feet ASAP, and need to be at 250 kts to do so, and in this case spoilers can be useful.
I want to descend and slow down
In a jet, this can be hard when clean.  Often the choice is descend or slow down.  When you need to do both, spoilers can be a great help.

In the case of landing or rejected takeoff, all of the spoilers (including flight spoilers) should deploy automatically on most airplanes when the thrust levers are moved to idle, there is weight-on-wheels and you are above some threshold speed.
In addition, spoilers are useful in some airplanes for roll control, in addition to airplanes with pure spoileron roll control.  I didn't spend much time on this topic as like the ground spoilers in landing and RTO, these are passive from a pilot point of view -- you aren't specifically controlling these spoilers, the flight control system is doing it for you.  In any case, the spoilers used for roll control are quite important during flight.
As you can see, spoilers have many uses in flight and not just for landing.