All parks are open for at least an hour or maybe two before they are really closed. At closing they don't start to clear the park just shutdown the attraction lines..
At Epcot WS closes at 9:00 and then they do Illuminations. At DHS many times there will be a Fantasmic that starts at closing.
Some people even get ADRs that start right before the park "closes".
One other thing you need to know about Epcot closing, they say FW closes at 7:00 but in reality all the big attractions, Soaring, TT, Spaceship Earth, The Seas with Nemo and Mission space are open until 9:00.