With that said there is always a question of whether you should hold your position to expiration realizing the full credit and saving on commissions if the spread goes to 0, or buy back the spread lower after you have gained a significant amount of the possible profit (80% or so of the initial credit).
It definitely varies by circumstances and potential catalysts on deck for the underlying but I would say that it is almost ALWAYS beneficial to cover your spread for gains before expiration if you are just trying to collect the final few nickels or dimes. If you have ever heard the expression, "Picking up nickels in front of a steamroller," then you should know that the holding out for the last dime when other opportunities are a passin' is going to eventually result in a situation like what happened in POT this week.
So what happened? As you can see in the chart Potash (POT) has been a hot stock the last several months. However just this week the company came out with news that pricing power will fall and thus the stock fell out of bed Wednesday morning. After being above 110 the day before, the stock closed that day at around 95 slicing thru its 200 day ema.
In mid May I sold a June 95/90 put spread for $1.65 and the trade worked well right out of the gate (of course in hindsight I should have just bought calls since the rally was huge). I then covered the spread at .20 in early June with still two weeks until expiration thinking that holding out for the last few dimes was greedy. This turned out to be the right move as the collapse in POT this week would have wiped out a majority of my profits.
I am not trying to gloat but simply point out that the next time you ask yourself whether or not you should cover your short credit after a nice gain; just do it. The risk/reward of holding out for the last few pennies is rarely worth the opportunity cost of missing that other mover on your radar screen so take those profits and move them into the next trade.