Let's ask the IRS:
Alien Residency - Green Card Test
You are a resident, for U.S. federal tax purposes, if you are a Lawful
Permanent Resident of the United States at any time during the
calendar year. This is known as the "green card" test.
You are a Lawful Permanent Resident of the United States, at any time,
if you have been given the privilege, according to the immigration
laws, of residing permanently in the United States as an immigrant.
You generally have this status if the U.S. Citizenship and Immigration
Services (USCIS) issued you an alien registration card, Form I-551,
also known as a "green card."
If you meet the green card test at anytime during the calendar year,
but do not meet the substantial presence test for that year, your
residency starting date is the first day on which you are present in
the United States as a Lawful Permanent Resident.
So what is the substantial presence test? The IRS says:
Substantial Presence Test
You will be considered a United States resident for tax purposes if
you meet the substantial presence test for the calendar year. To meet
this test, you must be physically present in the United States (U.S.)
on at least:
- 31 days during the current year, and
- 183 days during the 3-year period
that includes the current year and the 2 years immediately before
- All the days you were present in the current year, and
- 1/3 of the days you were present in the first year before the current
- 1/6 of the days you were present in the second year before
the current year.
If you arrive on August 1st 2018, get married the next day and apply for Adjustment of Status the day after that, it's still going to take "up to 120 days" (spoiler alert, it takes 120 days) to get your Green Card. You won't have met the 183-days-in-the-last-3-years requirement (unless you have from prior, non-exemptsee below visits). So your taxable residency will start the day you receive your Green Card status (it does not backdate to January 1st 2018).
Side note, if you came in on a K visa then you can't legally work while you're waiting for your Green Card to come through. This is stupid, it sucks, it also just happens to be the law. So you won't have any US earnings for the entire time you are present in the US up until your marriage and up to 3 months after. Anyway, I digress.
I think it's unlikely you're going to have a green card in hand and US income before the end of this year and therefore it's unlikely you'll have to pay US federal taxes for 2018. However, if you've spent a lot of time travelling to the US in previous years for any reasons that are not exemptsee below then you might still end up meeting the substantial presence test even though you didn't have your Green Card before the year ends. If that happens then you will have to pay US taxes on your worldwide income for the whole tax year.
If you do have to pay taxes, bear in mind that the USA and UK have double taxation treaties, so you will probably not have to pay taxes on the portion of your income that was already taxed by HMRC, or if you do, you only have to pay the difference between what you were actually taxed and what your US income tax rate would have been on the same amount of income. There is enough material there for a whole different question though, so I won't go into the details here.
Upon further review, there is an entire article dedicated to your specific question on the IRS website. There are many different rules depending on various specific situations, so rather than paste the whole thing or excerpt any particular section, I recommend reading the whole thing.
Do not count days for which you are an exempt
individual. The term "exempt individual" does not refer to someone
exempt from U.S. tax, but to anyone in the following categories:
- An individual temporarily present in the U.S. as a foreign
government-related individual under an “A” or “G” visa, other than
individuals holding “A-3” or “G-5” class visas.
- A teacher or trainee
temporarily present in the U.S. under a "J" or "Q" visa, who
substantially complies with the requirements of the visa.
- A student
temporarily present in the U.S. under an "F," "J," "M," or "Q" visa,
who substantially complies with the requirements of the visa.
- A professional athlete temporarily in the U.S. to compete in a charitable sports event.