Generally, once you have legally (i.e. legally admitted immigrant) lived in the US for five years you can apply for US Citizenship. However, if you are married to a US Citizen or enlisted in the US Military, then it can be as short as three years.
However, it is NOT automatic. No matter how long you have lived in the US, you still must APPLY to become a citizen (there is an application processing fee and other paperwork you will have to submit), and through the application process, you must be found to meet all the requirements for US citizenship.
**************************************************************
N O! discuss your options with a lawyer!!