A schedule is posted as to which parks are open the hour early in the morning and which stay open at night. It is on the disney web site and can also be found here. Although it is fairly consistent, it can change over time.
For the morning EMH you are supposed to have to show your room card in order to be allowed in. This is not always done.
For the night EMH you need to get a wristband. These are given out at various places around the EMH park, and also at the entrance to the park. You need to show your room key to get a wrist band. Each person needs to have the key to get a wristband. Then once the 'official' closing time has come, only people with the wristbands are allowed on the rides. Everyone can stay in the park, but they can't go on any rides.
We have found that the morning EMH is best, especially if you can get to the park at the EMH opening time. The parks are generally fairly empty and you can get a lot done. For the night EMH, since the parks already have a lot of people in them, it is not until a few hours have gone by and people start to leave that the lines start to get smaller.