Hello, I'm new to this board and have been following it for awhile as I'm considering expediting when I retire.
Anyway, I am currently deployed and I'm Unit Security Manager for 2 squadrons. You must have a reason to have a security clearance, such as Military service in a career field that requires a clearance(not all do...), government contracting, etc. In other words, you cannot simply apply for a clearance in anticipation of needing one, you must have a current need for one. After you are granted a clearance it will be for a specific level of classified information, such as Classified, Secret, Top Secret, etc. It will only be for the highest level of classification for which you need access to. Secret and lower clearances are valid for 10 years, TS and above are valid for 7 years. However, regardless of level clearance level required for your current needs, your access to classified information stops when you no longer have a "need to know". In other words, when you leave your current job, your access to classified information is suspended until some other agency applies for re-instatement of your access based on some current need. Your clearance is still valid, but you can't access classified information until you again have a "need to know" and your agency requests re-instates your access. For example, when you leave the military, your access is stopped, but can be restarted at any time an agency you work for requires it.
As greg334 stated the SF86 is the form that you will fill out to apply for a security clearance. To ensure timely investigation, make sure that you fill out the form completely with current verifiable information. If the investigators have to chase down people because you put down "unknown" or provide incomplete info, it will take months to get your application through. As it stands right now, it takes at least 4 months to complete an investigation, but count on it taking much longer.
If you've had a clearance in the past, and are within 10 years of your last investigation, it often only takes the investigators a month or so to complete a credit report, a local agency check, and a federal criminal records check. It's fairly simple to access the Joint Personnel Adjudication System to see if you are within 10 years, but you must have a OPM/DoD security manager with JPAS access to complete it.
Good Luck