The federal court system is made up of District Courts, Appeals Courts, and the Supreme Court.
There are 94 district courts across the country. Some states have only one district (e.g. Massachusetts), while others have more than one (e.g. California has four: Southern, Northern, Eastern, and Central).
Appeals courts, which hear appeals from the district courts, are arranged into regional circuits, each of which has the jurisdiction over a number of district courts. For example, the First Circuit hears appeals of cases from the District of Massachusetts (along with Maine, New Hampshire, Rhode Island, and Puerto Rico), and the Ninth Circuit hears appeals from the four districts of California (plus a number of other states of the west coast).
The Supreme Court is the highest court in the U.S., and hears appeals from both federal and state appeals courts.
State courts have at least two levels of court: the trial court(s), and the appeals court(s). Depending on the state, there may be other types of court. The Massachusetts court system consists of the Trial Courts (which is further divided depending on the type of case), the Appeals Court, and the Supreme Judicial Court.
The Wikipedia article List of courts in the United States outlines the structure of each state's court.
Whether a case is in a federal court or a state court depends on who has jurisdiction over the subject matter. A quick comparison can be found at the U.S. Courts web site.
In addition to general courts, there are a number of specialty courts (or tribunals) that only hear cases in a certain subject matters, for example, tax, bankruptcy, family law, patents, military law, etc.