How can i catch (with get_posts) attachment file (pdf, images) from a post when i have only inserted it from media library and it isn’t upload for it?

When you upload a media from a post, the post_parent attribute is setted to the post ID you are uploading from.
Not so when you simple insert a post from the library: in that case if the media was already attached to a post, its post_parent is already setted, and once a media can have only one parent, you can’t get the media using get_posts.

However, there are a lot of ways you can do the trick. If your aim is simply output something using the url of the media, probably best choice is a shortcode.

If you need the url to do something, you can use a regex to extract the pdf urls from the post content.

If you are using WP 3.7+, there is a function wp_extract_urls that help you a lot to perform that task.

Here I’m posting a general function to extract urls form a post content and collect them by their extension:

function post_media_urls( $target="" ) {
  if ( empty($target) )  {
    $target = get_the_content();
  } elseif ( is_numeric($target) ) {
    $post = get_post($target);
    $target = empty($post) ? FALSE : $post->post_content;
  }
  if ( empty($target) ) return false;
  // apply filters to support shortcodes
  $target = apply_filters('the_content', $target);
  // extract urls
  $urls = wp_extract_urls( $content );
  $out = array();
  if ( ! empty($urls) ) {
    // parse only several media extensions, but allow filtering 
    $exts = apply_filters( 'post_media_urls_exts', array('jpg','gif','png','pdf') );
    foreach( $urls as $url ) {
      $ext = strtolower( pathinfo( basename($url) , PATHINFO_EXTENSION ) );
      if ( $ext === 'jpeg' ) $ext="jpg";
      if ( ! empty($ext) && in_array( $ext, $exts) ) {
        if ( ! isset($out[$ext]) ) $out[$ext] = array();
        $out[$ext][] = $url;
      }
    }
  }
  return $out;
}

This function can be used in 3 ways. First is passing a post id:

$urls = post_media_urls(10);

Second is pass a post content (any string, indeed):

$urls = post_media_urls($post->post_content);

Third is using it inside a loop, without any argument, will be used the current post content:

$urls = post_media_urls();

In all 3 cases, what you get is an associative multidimensional array of urls where first level keys are file extensions (lowercased), something like:

Array(
  [pdf] => Array(
     [0] => 'http://example.com/wp-content/2014/01/sample.pdf',
     [1] => 'http://example.com/wp-content/2014/01/sample2.pdf'
  ),
  [jpg] => Array(
     [0] => 'http://example.com/wp-content/2014/01/sample.jpeg',
     [1] => 'http://example.com/wp-content/2014/01/sample2.jpg',
  ),
  [gif] => Array(
     [0] => 'http://example.com/wp-content/2014/01/sample.gif',
  )
)

In your example, the function should be used like this:

$args = array( 'category_name' => 'referenze', 'paged' => get_query_var('paged') );
$my_query_referenze = new WP_Query( $args );
while ( $my_query_referenze->have_posts() ) : $my_query_referenze->the_post();
  $content_referenze = apply_filters('the_content', get_the_content() );
  $attachments_referenze = post_media_urls();
  // to get only pdf
  if ( ! empty($attachments_referenze) && isset($attachments_referenze['pdf']) ) {
    foreach ( $attachments_referenze['pdf'] as $pdfurl ) {
      $indirizzoallegato_referenze = $pdfurl
    }
  }
endwhile;

Of course this function can be used only if the media urls you want to retrive are inserted inside the post content.

An additional note. The function do not parse all the urls, but only the urls that end with a set of specific file extensions, in this way any web link (e.g. to other site pages) are skipped.
I’ve used a very restricted set of extensions, but I’ve also inserted a filter 'post_media_urls_exts' to allow changing the allowed extensions.