Custom field front end update in wordpress

You would need to add your form to each post, adding in a hidden input with the post id each time. Then, when the nonce validates, be sure to read the passed in post id and use that with update_post_meta.

For example

if ( isset( ... ) ) {
   $target_post_id = ( isset($_POST['target_post_id']) )? (int)$_POST['target_post_id'] : 0;
   if ( $target_post_id > 0 ) {
      $data = stripcslashes($_POST['quemcomrpou']);
      update_post_meta( $target_post_id, 'quem_comprou3', $data);
   }
}

# In your posts loop where you draw each post
$posts_query = new WP_Query( $args );
if ( $posts_query->have_posts() ) {
    while ( $posts_query->have_posts() ) {
       $posts_query->the_post();
       $current_post_id = get_the_id();
       # ... anything else for this post
       $quemcomprou = get_post_meta($current_post_id, 'quem_comprou3', true);
       ?>
<form method="post" action="">
   <?php wp_nonce_field('update_drw_postmeta','drw_inventory'); ?>
   <label>This is label</label>
   <input type="text" name="quemcomprou" value="<?php echo $quemcomprou ?>" />
   <input type="hidden" name="target_post_id" value="<?php echo $current_post_id;?>" />
   <input type="submit" value="save" />
</form>
       <?php
   }
}

This would have to be done in the loop to work properly as you will have to:
1. Draw one form for each post, using the current posts id for target_post_id
2. Read the post meta for each post to display what is wanted.

It sounds like you are currently setting the value on the page you are looking at, then reading it and displaying it for each post.

Using $post on a page should give you the page, not a post shown on the page (unless you are in a custom loop).

To do it with one form and multiple posts, you would want to incrementally build out the form and then draw it after the loop:

$posts_query = new WP_Query( $args );
$post_items = array();
if ( $posts_query->have_posts() ) {
    while ( $posts_query->have_posts() ) {
       $posts_query->the_post();
       $current_post_id = get_the_id();
       # ... anything else for this post
       $quemcomprou = get_post_meta($current_post_id, 'quem_comprou3', true);
       $post_items[] = array(
          'quemcomprou' => $quemcomprou, 
          'id' => $current_post_id,
          'title' => get_the_title()
       );
       ?>
       <?php
   }
}
if ( 0 < count($post_items) ) {
    foreach ( $post_items as $item ) {
       $item_id = $item['id'];
       $bits .= <<<HTML
<hr />
<label>{$item['title']}</label>
<input type="text" name="quemcomprou[{$item_id}]" value="{$item['quemcomprou']}" />

HTML;

    }
}
?>
<form method="post" action="">
   <?php wp_nonce_field('update_drw_postmeta','drw_inventory'); ?>
   {$bits}
   <input type="submit" value="save" />
</form>

Your processing at the top would then have to check for and process an array type value:

if ( isset($_POST['quemcomprou']) && is_array($_POST['quemcomprou']) && 0 < count($_POST['quemcomprou']) ) {
   foreach ( $_POST['quemcomprou'] as $x_post_id => $value ) {
      $data = stripcslashes($value);
      $target_post_id = (int)$x_post_id;
      update_post_meta( $target_post_id, 'quem_comprou3', $data);
   }
}