You have the right to not speak to law enforcement and it is advisable that you do not if believe you may be a suspect in the investigation of a crime or if you may have committed a criminal act.  Talk to an attorney right away if a police officer contacts you and wants to speak with you. 

If you are taken into custody, you have the right to know why.  An officer must tell you the grounds for your arrest. 

A "stop and frisk" is when a police officer stops a person to question them and, for self-protection only, carries out a limited pat-down search for weapons (a "frisk").
A police officer may stop and frisk a person if the officer has a "reasonable suspicion" that the person is engaged in criminal activity. This is an easier test for a police officer to meet than the "probable cause" that is required to make an arrest. In one recent U.S. Supreme Court case, the Court ruled that running away from the police is enough of a reason for the police to stop and frisk the defendant.
When frisking a person for weapons, police may feel a suspicious package that the officer knows is commonly used to carry illegal drugs or some other illegal substance. This suspicion may turn into sufficient cause for a more intensive search of the person's clothing. And, if a search produces an illegal substance, it may result in an arrest.

A police officer's investigation based on reasonable suspicion should only last as long as is reasonably necessary for them to quickly confirm or deny their suspicion. If you are not being reasonably detained on suspicion of the commission of a crime, you are free to leave. 

At all times, act reasonably and respectfully in asserting your rights.