First, your code will not compile since `folderName` might not be initialized before accessing it...

Secondly, the code runs fine on my end.. Are you sure your `folder` contains subfolders? (i.e. `folder.Folders.Count > 0` is really `true`?)

I used the following code - which uses yours only slightly (`string folderName = null;` instead of `string folderName;`) modified:

    private static void Main(string[] args)
    {
        var url = "https://my.share.point/sites/asdf/";

        using (var ctx = new ClientContext(url))
        {
            var folder = ctx.Site.RootWeb.Lists.GetByTitle("Blubb").RootFolder;
            ctx.Load(folder);
            ctx.ExecuteQuery();
            var sb = new StringBuilder();
            Console.WriteLine(browse(folder, ctx, ref sb));
            Console.WriteLine(sb.ToString());
        }

        Console.WriteLine("done");
        Console.ReadLine();
    }

    private static string browse(Folder folder,
        ClientContext ctx, ref StringBuilder str)
    {
        string folderName = null;
        str.AppendLine("browse" + folder.Name);

        ctx.Load(folder.Folders);

        ctx.ExecuteQuery();

        if (folder.Folders.Count > 0)
            for (var i = 0; i < folder.Folders.Count; i++)
            {
                browse(folder.Folders[i], ctx, ref str);
                folderName = folder.Folders[i].Name;
            }
        return folderName;
    }

The list looks like this:  
[![Folder-Structure in my list][1]][1]

and the outcome like this:  
[![Outcome of the code][2]][2]

To explain this further I ["transplanted" your algorithm to ideone][3]. Have a look at it - there's nothing wrong with the algorithm itself (depending on what you were expecting).


  [1]: https://i.sstatic.net/sZLGU.png
  [2]: https://i.sstatic.net/aLIwV.png
  [3]: http://ideone.com/nH9b2f