Mr. Biden’s office said he had been diagnosed with Stage 4 prostate cancer that had spread to his bones.