Do all states require you to fill out paperwork when you buy a gun so that they know who bought the gun?

Federal law requires that all dealers maintain a record of sales at their premises. This is a form 4473. Federal law applies in all states, territories, possesion and Commonwealths of the US.