Add CSS class to fields
Make a copy of your_drupal_site/modules/field/theme/field.tpl.php in your theme directory and name it field--field_related.tpl.php  In this file  You can attach the class (grid_1) to each field as follows:

&lt;?php foreach ($items as $delta =&gt; $item) : ?&gt;        
&lt;div class="grid_1"&gt;&lt;?php print render($item); ?&gt;&lt;/div&gt;
 &lt;?php endforeach; ?&gt;


All the available variables are listed in the comments of this file so you will be able to customize as you like.

On any given node you can check how many fields have been created and theme according to that. You can change the above code to count how many fields are there on any node, the revised code is as follows:

&lt;?php foreach ($items as $delta =&gt; $item) : ?&gt; 
    &lt;?php
    if (count($items) &gt; 2) {
        print '&lt;div class="grid_1"&gt;' . render($item) . '&lt;/div&gt;';
    } else {
        print '&lt;div class="two_or_less"&gt;' . render($item) . '&lt;/div&gt;';
    }
    ?&gt;
&lt;?php endforeach; ?&gt;


This will add class "grid_1" to any node with 3 or more fields of field_related and add class "two_or_less" to the nodes with 1 and two fields.