"Did you sleep well?" is the grammatically correct way to say it. The present perfect is used for actions that started in the past and continue in the present. It can also be used for the recent past (Have you just woken up?) In this case, I would say to use the simple past because the person definitely has to be awake to be asked how they slept. Therefore, the action of sleeping is completed. It sounds weird to use the recent past form with the present perfect. Hope I helped!