Actually, both ad-hoc and temporary appointments are of temporary nature when an incumbent cannot be appointed substantively (permanently) against any post due to one or the other reason. However, there is a clear difference between ad-hoc appointment and temporary appointment, as follows:
Ad-hoc appointment is that which is made out of the eligible senior most candidates of the organization, as a whole, for promotion against the existing permanent posts or any specialist engaged for specifically created post/purpose for solution to immediate problems or to serve immediate needs. These appointments are made when the management is not in a position to fill such vacancies permanently for want of certain complications or due to non-fulfillment of the required formalities well in time. For example, a DPC is delayed for want of availability of all Confidential Records (CRs)/ Self Apparaisals, etc., or a post of Officer on Special Duty is created for a specific purpose and period, or a Committee or Commission is appointed to go in to some specific problem to find out solution for that.
On the other hand, Temporary Appointment on the other hand, is that which is made on temporary basis against temporary posts for a specific/ short period by recruitment from outside (if Rules of the organization permit), or on local basis out of the candidates of subordinate services to fill in he vacancies until the poss are made permanent and regular appointments cannot be made as per rules. Temporary posts are created or filled up for a limited time to meet with the needs of the organization to cope with the temporary increase of workload. Temporary appointments from out of the local candidates, with due respect to their local seniority, are made for a very short period. If long term temporary vacancy is there the appointment is made out of the senior most candidates of the recruiting area/organization, as a whole, as the case may be.