How can I make a field appears when you check on a checkbox?
You can use #states from FormAPI that drupal provides.
Below is the link
https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#states

Below is the code from drupal form api

$form['email_canceled']['settings'] = array(
    '#type' =&gt; 'container',
    '#states' =&gt; array(
      // Hide the settings when the cancel notify checkbox is disabled.
      'invisible' =&gt; array(
       ':input[name="email_canceled_toggle"]' =&gt; array('checked' =&gt; FALSE),
      ),
    ),
  );