Pelosi's role as Speaker is only for the 116th Congress.  Their term expires on January 3, 2021.  The  117th Congress, including those elected on Nov. 3, 2020 would have to elect a Speaker.  If the Republicans retake the House, it won't be Pelosi.