If the sun somehow collapsed to form a black hole, it would have the same mass but its size will be much smaller. The gravitational force between the sun and the earth is independent of the size of the sun. So, the orbit of earth or any planet would not be affected.
Home
Gravitation Reasonings
If the sun somehow collapsed to form a black hole, what effect would this event have on the orbit of the earth?