The general rule is that the police need a warrant, approved by a judge, to "bug" conversations.

The more specific rule is that some states require only that one person in the conversation is aware of the recording. Other states are "two-party" consent states and you cannot record another person's voice unless they are aware of it (either you told them or they can see you are recording them).

There are other exceptions for things that police do, such as the Foreign Intelligence Surveillance Act, which has been interpreted (by some) to authorize secret listening and recording of any conversation with a person who is not in America.

If you come back with another question about recording in your particular state, maybe someone can help you look it up. Or you can search the web for "two-party consent YourState" and see whatzzup.