WASHINGTON—The Supreme Court granted former Virginia Gov. Bob McDonnell’s plea to avoid prison while he pursues an appeal of his convictions on federal corruption charges.

Mr. McDonnell was sentenced to two years’ imprisonment following his January conviction on what prosecutors characterized as a “quid pro quo bribery scheme” with a Virginia businessman seeking to promote a dietary supplement product.

In...