There are no official "time limits" on the USMLE. The USMLE itself does not declare that the exams need to be taken in any specific time frame, nor is there any rule that your scores expire.
Some states have set limits on the number of years to complete the USMLE. Often this is 7 or 10 years. Some states have no limits. If there is a limit, it means that you must complete all steps (time from first exam to last exam) within the timeframe to be eligible for a license in that state.
Residency programs do not have an "expire date" for USMLE exams. However, many residency programs do have limits on how far out from medical school graduation you are, and if your USMLE exams are >7 years out then you're probably over the graduation limit. Some programs do not have a limit.
Thus, if you complete the USMLE's in >7 years, nothing special happens. You (presumably) get a spot in a residency program and complete it. The problem begins when you request a full license in a state that has a USMLE limit. This could be because 1) you graduate from residency and then apply for a license somewhere, or 2) your state requires a full license for your PGY-3 (several states require this, most notably california).
When you apply for a license in a state that has a USMLE limit that you have exceeded, they review your license application. They could waive the USMLE limit and give you a license anyway. Or, they could require that you retake your first exam (to get all of your exam passes within the limit). If they require a retake, you get that in writing and then the USMLE allows you to take the step again.
So, your question never actually happens. Even if you are not in a training program, you can take Step 3 once you have passed Steps 1 and 2 and graduated from medical school. Even if you don't do this and your USMLE's become "old", you can't simply retake them. The USMLE will only allow a retake of a passed step if you have a letter requiring this from a licensing authority, which you can't get without doing a residency, which defeats the point of your question.
Complicated. If it doesn't make sense, post again.