For questions about actions that happened at an unspecified time before now with relevance to the present, we use present perfect (Have you finished). 'Did you finish' is simple past, used for specific past times. 'Had you finished' is past perfect, used for earlier past.