Each state has its own set of laws governing unemployment benefits. Most look at the issue of how long you have to work somewhere to collect unemployment in terms of quarters. Most states require you to spent two quarters employed somewhere before you are eligible for these benefits. This means you would have to stay with a company for six consecutive months before there was any possibility of you being able to claim unemployment in the event your job suddenly ended.
The length of time you need to have worked before you can collect unemployment depends on the state you live in. In New Jersey, for instance, you need to have worked for at least 20 weeks before you can collect. For more information see: http://lwd.dol.state.nj.us/labor/forms_pdfs/ui/PR-94.pdf.
While unemployment laws vary from state to state, generally you have to work two quarters, or six months, at a job to be eligible to collect unemployment. Check with your state's local unemployment office to get the exact regulations for your state.