What is the legal residency status of a foreigner who marries a US citizen during a visit?

You must immediately apply for a permanent resident status.