The law throughout the United States is that the police may not detain an individual whom they have stopped for any longer than necessary to accomplish their reason for stopping that person in the first place.
For example, say that the police stop your car because you are driving 10 miles per hour over the posted speed limit. While the police have a right to stop your car and issue you a citation for speeding, they do not ordinarily have the right to keep you by the side of the road for any longer than it takes to write the citation.
What happens all too often, however, is that the police do keep individuals by the side of the road for longer than it takes to issue a citation based on a mere hunch that the driver may have contraband such as drugs or guns hidden in her car. When that happens, the police will sometimes radio in to their headquarters and ask that a dog that has been trained to detect drugs be sent to their location in order to see whether the dog alerts to any drugs in or around the vehicle. If the dog does alert to drugs which are eventually located by the police, the driver of the car will almost always be arrested and taken to jail.
Because the driver was detained for longer than it should have taken to simply issue a citation for speeding, that driver's lawyer would be well advised to consider filing a motion to suppress the evidence that was discovered by the police as a result of this arguably illegal search and seizure.