Retesting After Failure – 14 CFR 61.49
A practical test can only have one of the 3 outcomes – Pass, Fail, or Discontinue. Of course the desired result is always to end up with a “Pass”, but then there are times when it does end up with a “Fail” or a “Discontinuation”. We are discussing the “Fail” scenario here.
A practical test results in a “Fail” when the applicant fails to meet the standards laid down in the appropriate PTS or ACS for any Area of Operation. (Refer 14 CFR 61.43.)
Per 14 CFR 61.49, if an applicant fails a practical test, he/she must receive additional/necessary training time from an authorized instructor (as required) and receive a logbook endorsement before attempting to retest for the practical test.
If the additional/necessary training time includes flight training, then it should be logged in accordance with 14 CFR 61.51.
Practical Test means ground/oral portion and flight portion together. There is no separation or distinction between oral or flight portion. Refer to 14 CFR 61.1.
A sample endorsement is available in AC 61.65H – endorsement number A.73 on page A-19.

But, what is the additional/necessary training time?
Additional/Necessary training time is whatever training time the authorized instructor deems necessary. Your student may have failed the “ground” or “oral” or “flight” portion; but you get to decide what additional training time is needed. You make that determination and provide the training, followed by an endorsement and then send them back for a retest. The DPE has no say in what that additional/necessary training time should be. The DPE’s function is to test the applicant. Your function is to train them.
Refer to Ragland (2015) Legal Interpretation here.