Under Windows 95 and higher, long filenames are supported. Compiling for the Windows target ensures that long filenames are supported in all functions that do file or disk access in any way.
Moreover, Free Pascal supports the use of long filenames in the system unit and the Dos unit also for go32v2 executables. The system unit contains the boolean variable LFNsupport. If it is set to True then all system unit functions and Dos unit functions will use long file names if they are available. This should be so on Windows 95 and 98, but not on Windows NT or Windows 2000. The system unit will check this by calling dos function 71A0h and checking whether long filenames are supported on the C: drive.
It is possible to disable the long filename support by setting the LFNSupport variable to False; but in general it is recommended to compile programs that need long filenames as native Windows applications.