When would a Mormon choose to go to the temple instead of the church? The accepted answer to this other question mentions that Mormons have two types of meeting locations: temples and churches.

According to the answer, the churches have a 3-hour meeting every Sunday.

In what kind of cases or times would a Mormon then visit a temple for a meeting?
It's not a choice between the two as the question seems to be asking.  The temple is not actually a meetinghouse where ordinary worship services are held.  (In fact, temples are closed on Sundays.)  Latter-Day Saints regard the temple as the House of the Lord, a highly sacred place where, like the temple in the Old Testament, very special, sacred ordinances are performed.

The majority of the work that takes place in temples has to do with the LDS doctrine of salvation for the dead.  Mormons believe that those who died without the Gospel can accept it in the hereafter, as has been discussed elsewhere on this site, but also that certain saving ordinances, such as baptism and confirmation, are necessary for salvation.  This apparent dilemma is resolved by proxy work: in the temple, people can do this work on behalf of those who have passed on, consistent with Paul's mention in 1 Corinthians of baptism for the dead.  As far as I'm aware, ordinances on behalf of the dead cannot be performed anywhere but inside a temple.