It has been my experience that the crowds start gradually dispersing from Magic Kingdom from about dinnertime on. The keyword here is gradual. There isn't a mass exodus until the park officially closes. A good number of people stay for the evening parade and fireworks, but if you are willing to forgo watching these events, wait times can be very low at certain attractions! A good tip: If you have the time, space out Magic Kingdom over two days. One night, watch the parade and fireworks. The other night, use the time when others are staking out their parade-viewing spots, etc. and ride all of the attractions you can!
An important side note: Don't count on getting Fastpasses into the evening hours. There are only a certain number of Fastpasses to be allotted each day, and once they're gone, they're gone. Utilize them in the peak park hours, which are typically between 10:00 am and 12 noon.
With Disney, the word "crowded" is obviously relative. In peak season, it will always seem like it's swamped with people (in most cases). But crowds will slowly start to disperse and young children will start having meltdowns at a certain point in the day, so you will be able to enjoy the Magic Kingdom well into the evening. Also, in the summer months, the evenings bring relatively cooler weather, so it's a nice change of pace.
Let me know if you have any other questions!