A case can be "dismissed" at (most) any time (however, the further along in the process a case is, the less likely a judge will allow a case to be dismissed without very good reason).
A case can be dismissed with or without "prejudice", which in this legal context means essentially "finality". A case dismissed with prejudice cannot be brought again, while a case dismissed without prejudice can be refiled. (Compare the criminal law concept of "double jeopardy", though as phoog correctly notes, "double jeopardy" only applies in criminal trials, while prejudice can be applied in both civil and criminal courts).
Many cases are dismissed without looking at the evidence (or even having the evidence admitted to the record); this is called "summary judgement" or "judgement as a matter of law". There are generally three cases when this happens:
First, if the prosecution or plaintiff (i.e. the party bringing accusations) has "failed to state a claim upon which relief may be granted", i.e. asked for something the court cannot grant.
Second, is if the defendant can show, that even if everything alledged by the plaintiff is true, that the necessarily elements of the crime or offense have not been proven.
Third, is if there are no facts in dispute, and only a disagreement on interpreting the law.