How can i count the images that are atacht to NextGEN Gallery

Assuming you actually have something in the $gallery object (hint: confirm that by print_r($gallery) in your template), then your code should work. Perhaps step back and leave the database stuff to NextGEN, just count the image IDs:

global $nggdb;
$poze = get_field('poze');
if ($poze && count($poze)) {
    $galleryID = $poze[0]['ngg_id'];
    $imageIDs = $nggdb->get_ids_from_gallery($galleryID);
    $count = count($imageIDs);
}