How do I change the uploaded file name after the node has been saved? How can I change the name of an uploaded file after the node has been saved?
I know there is the FileField Paths module for this purpose, but it's still buggy for Drupal 7. I looked at the source of the module, but I can't extract the necessary code.

The only thing I know is that I  should use hook_node_update() and field_attach_update(), but I don't know how to use them.
Perhaps this will help you.  Last night I wrote a code which is meant to auto-generate a file and attach it to the node.  When the node is about to be saved, the function removes the uploaded file from the node and creates and attaches the new file.  

In your case, you might be able to just update the file name with file_copy and resetting the filefield.  

    function MODULE_node_presave($node) {
    /*
    *  Out with the old - detach file object
    */

    if (isset($node-&gt;field_filefieldname['und'][0]['fid'])) {
     file_delete(file_load($node-&gt;field_filefieldname['und'][0]['fid']));
    }
    unset($node-&gt;field_filefieldname['und'][0]);  //just for good measure

    /*
    *  In with the new
    */

    $filename = 'newfilename.dot';
    $filepath = conf_path().'/files/yourpath/';
    $touchout = $node-&gt;title;

    $tempFile = file_directory_temp().'/'.$filename;

    file_put_contents($tempFile, $touchout);

    $file = (object) array(
        'uid' =&gt; 1,
        'uri' =&gt; $tempFile,
        'filemime' =&gt; file_get_mimetype($tempFile),
        'status' =&gt; 1,
        'display' =&gt; 1,
      );

   /*
   *  File save operation, puts file in /sites/default/files and records update in db
   */ 

    if (file_prepare_directory($filepath, FILE_CREATE_DIRECTORY)) {
     $file = file_copy($file, 'public://path/'.$filename, FILE_EXISTS_REPLACE);
    }

   /*
   *  Reattaches our severed file, good as new.  
   */

    $node-&gt;field_filefieldname['und'][0] = (array)$file;
    }
    ?&gt;