There is a difference between detaining someone using the authority of law and merely asking questions. Any police officer may ask any free person questions in a voluntary manner. That is called a consensual encounter. Your rights during a consensual encounter are generally to decline to answer questions and/or walk away if you wish. If you have not been detained by some objective use of an officer’s authority (official commands, use of force, physical seizure, etc.), you are likely free to leave. However, if an officer’s questions are accompanied by obligatory commands, threats of force, arrest, or other types of seizure, such that a reasonable person would not feel free to leave, the encounter generally turns into a detention and/or arrest.
A police officer must have reasonable suspicion to detain for a limited timeframe during a Terry stop/detention and must have probable cause to make an arrest. That is why the ACLU and other know your rights groups teach that when you are in an encounter with an officer, you should always inquire – am I under arrest? Am I being detained? Am I free to leave? If the officer answers yes to the first two questions or no to the third, you know the officer must possess articulable facts that would be sufficient for the type of seizure he/she has placed you in.
In all circumstances that a police officer uses his/her official authority to detain/arrest you, you should comply with commands and later let your lawyer argue whether the officer had sufficient information to establish the proof necessary for the type of seizure at issue.