“What if I married somebody different than the person who petitioned me for a K-1 visa?”
This is not an uncommon situation. An applicant will enter the United States on a fiancée visa and for whatever reason, they don’t get married to the person who petitioned them. On a K-1 visa, the applicant must get married within 90 days or leave the United States.
While it is possible to still apply for a green card through marriage through somebody else, you will have to leave the United States and begin the whole visa process again. Importantly, if you marry an individual other than the K-1 sponsor, you will be barred from changing to another visa status or adjusting to a green card in the United States.
The safest solution is to leave the United States and start the process again.