After you have successfully completed your exam, you have two years to become registered or licensed to prevent your completion status from becoming invalid. Once you do obtain employment, the hiring firm must submit form U-4 to the Financial Industry Regulatory Authority
or FINRA. A state fee must also be paid and a background check performed.
So long as you are registered (employed), your exam completion will not expire. However, if your employment with the firm is terminated (either by yourself or the firm), your registration with the state is also terminated. To prevent having to re-write the exam, which is necessary to change an expired status with the Central Registration Depository (CRD), you must, within two years, obtain employment with a firm that will register you with the state.
As a side note, the NASAA indicates that it is sometimes possible for the state to waive an expired exam status if the individual was working within the financial services industry in a position that did not require registration. Further information on waiver policies and guidelines can be found here