typically for any gun you will need to pass a background check. It is automated so can be completed quickly. The background check checks for crimes, can't remember specific details, or a court order of being mentally unfit, again can't remember the details.
You can buy from a friend or private buyer without the background check. Private sellers at gun show do not require a check. However a federally licensed dealer I know, he does gun repair and other work, mentioned at the shows most of the private tables send their buyers over to him or another licensed dealer to get a background check. He charges a couple of bucks over cost for it, takes him maybe 3 - 5 minutes. He and some dealers sell parts, equipment and the like but not guns so the private sellers aren't worried about losing a sale.
Some states require more then the background check, such as permits, licenses, registration even then it can depend on the type of gun, handgun vs rifle. States have varying laws about transporting guns. New York has strict laws about owning guns as well as laws about transporting guns into the state. You could go out of the state, buy a gun without meeting NY's requirements and laws but the minute you carried it into NY you would be breaking the law and would be a criminal. Live in another state, own a gun, traveling to NY with it, you have likely committed a crime. Many states have reciprocity laws for conceal carry and crossing state lines. Depending on the state some dealers will not sell to out of state buyers unless they complete the purchase using a licensed dealer in the home state.
For a state dl typically you won't need to pass a background check. You will need to have some form of id. If it is not real id often a bill sent to your address and your previous drivers license is enough. Real id requires a combo, SSN card , birth certificate, passport ... and then another type of id, don't remember the whole list.