Speaker John A. Boehner, an Ohio barkeeper’s son who rode a conservative wave to one of the highest positions in government, said Friday he would relinquish his gavel and resign from Congress, undone by the very Republicans who swept him into power.