The Grid format (along with the coverage format) use INFO tables, which have a 128-character name limit. The only time this limit will be encountered is when the name of the input or output dataset is a Grid (or a coverage) and its path exceeds 128 characters, or if your location for intermediate datasets would cause the dataset path to be greater than 128 characters (as some intermediate datasets use INFO files).
When specifying Grid (or coverage) format data, make sure the full directory path, including the name, has fewer than 128 characters.
Try specifying an environment scratch workspace and current workspace to be a file directory, so that intermediate data created during analysis will be fewer than 128 characters. Alternatively, using a file geodatabase for the environment workspace path will not have this limit.
If the problem persists, it is possible that the environment workspace is not being applied. Check that the system variables ARCTMPDIR, TEMP, or TMP are valid and specified correctly.