Normally, criminal charges are filed promptly. However, for a misdemeanor crime, the statute of limitations or the time limit within which the district attorney MUST file charges, is one year from the date of arrest. There are many reasons that the charges may not be filed in a timely manner by the prosecutor's office, but unless a year has passed you are still subject to having charges filed against you unless they are formally dismissed by the district attorney's office.
For a felony, which is a serious crime that carries a penalty of a at least 16 months in state prison, the time frames can differ depending on the crime. Generally it is 3 years from the date of arrest but there are many exceptions. For example the statute of limitations for fraud is 4 years from the discovery of the fraud. In a serious felony the time frame can be much longer than 4 years and for the most serious of crimes, murder, there is no statute of limitations. That's why cold cases can be filed years or even decades later.
If you think charges may be filed against you, it is best to see an experienced criminal defense lawyer immediately. There are instances where prompt investigation and intervention can either lessen the severity of the charges filed or even result in the case not being filed in the first place.