Close commenting after X comments have been posted
You could use the drupal rules module to set up a system to close your comments after X amount of comments. In combination with the views bulk operations module, you could set up a rule for "new comment has been posted." 

For the condition compare the number of results from a VBO created that counts the number of comments on the node the comment was posted to and compare it to the number of comments you want before closing. If there are 20 comments posted and the number you want to close at is 20 the rule will move on to the action. 

The action would be a custom php snippet to set comments from read / write to read only. The snippet I was using for Drupal 6 was 

$node-&gt;comment = '1'; 
return array("node" =&gt; $node);


so it may need to be modified slightly for 7. 

With that all being said, if you are looking to set up an event registration setup where a certain number of people can sign up, you are actually looking for the entity registration module.

From the drupal.org website


  Entity Registration does lots of things you are expecting from a
  registration system (like allowing you to restrict the number of total
  registrations for a given event), and other stuff you are crossing
  your fingers and hoping for (like building in automated reminder
  messages for your registrants).