Twenty-fifth Amendment to the United States Constitution
If two-thirds of each House of Congress votes that the President still cannot do their job, the Vice President would continue to be Acting President.  If Congress does not vote this way, or if they do not vote at all within 21 days, the President takes over the Presidency again.