Probably a lot will depend on how long the lines are and if you have express pass.
If the park, say, closes at 8, and the regular line is at a half hour wait...they USUALLY stop letting people get in line at 7:30. Those people will be just boarding the ride at 8, then riding, then making their way out of the park. If they kept letting people in a long line, the park would never close...haha!
But, if the line is shorter or you have express pass, they usually take that into consideration. As with all theme parks, they do try to keep people happy, so they don't yank people out of line & kick them out...but they have to stop the queue sometime.
So, yes, the parks do stay open about an hour after "closing time" to let people finish up and meander out; but if a line in already at a half hour wait, I wouldn't plan on jumping in line at 5 mins til closing.