As someone who is legally in the United States on a valid visa (such as in student or temporary worker status), how to handle fear of returning to your home country can be tricky. Technically, the law says there is a one-year deadline between entering the U.S. and applying for asylum. But U.S. Citizenship and Immigration Services (USCIS) often follows a policy of making an exception for people who were in lawful status, so long as they apply for asylum within a reasonable time after falling out of status.
Should you apply now or wait until you are no longer in lawful status? (For purposes of eligibility to apply for asylum, it doesn't matter whether you have a valid visa or are in the U.S. unlawfully.) This is ultimately a strategic question.
The date by which you must depart the U.S. is likely on a document called an I-94, which you can access online. If you are a student, you might be allowed to stay for the duration of your status (D/S); that is, until your program of studies is over.
You may be able to remain in the U.S. legally for some years, by extending your work visa status or applying to another U.S. academic or vocational program for additional study or training.
Applying for asylum immediately, however, might be in your best interest so as to more quickly obtain work authorization.
More people have applied for asylum in recent years than the system can handle. Many people can expect to wait years for a decision. As of 2018 USCIS is, however, attempting a "first in, first out" system of handling applications, meaning the latest people to apply may be heard before the rest of the backlog.
In any case, you might well be out of status before a final decision is made on your asylum application. You will be allowed to stay in the U.S. while awaiting that decision.
Applicants with any lawful status, such as a tourist visa, student visa, or work visa, typically receive the asylum decision by mail a few weeks after the asylum interview. If the officer does not grant asylum, you will receive a Notice of Intent to Deny (NOID) explaining why. You will have 16 days to respond to the NOID.
Assuming you reply, the officer will read your response and think about whether to change his or her mind. If the officer does have a change of mind, you will receive a grant of asylum in the mail. Otherwise, you will receive a final denial.
If you are denied asylum you will remain in whatever status you were in before. If you are not in lawful status, you will normally be issued what's called a Notice to Appear (NTA) in Immigration Court. During the court proceedings, you can renew the asylum case before a judge.
If you receive a final denial and no Notice to Appear, you will not be able to have your asylum claim heard by an immigration judge until you are placed into removal proceedings. In this situation, you are entitled to apply for asylum again, since your application was denied by an asylum officer and not by an immigration judge.
It can be helpful to consult with an attorney who specializes in immigration law in order to discuss and strategize your timing.