In theory you have until the boarding door closes and the gate agent "closes" the flight at the airport.
In practice you should really do this no later than 30 minutes before scheduled departure time just to ensure you don't hit any snares when you call in and request the refund.
It's also possible to get a refund after the flight closes by telling them you wanted to SDC but now simply want to cancel it; but you need to find an agent willing to do this for you.
Tell us your situation and we can give better advice.
-RM