Whether it is a text or an icon, you can use this free Photoshop Action designed by Zinx to apply long shadow effect. There are a lot of Long Shadow Generator Actions for Photoshop but I am not satisfied with anyone of them because they don't let you customize the shadow. They set their own opacities and fill.
So, I decided to make my own Photoshop Action to create shadow of text content and leave it as it is, as we can set the Opacity manually as per the desire.
How to Use this Photoshop Action
Download the actions from the link below and install it on your Photoshop. Since I made it on Adobe Photoshop CC, it should work on major versions of Photoshop. Double click the .atn file to install it.
There are 2 actions LS #1 and LS#2.
LS #1 creates short shadows. Run LS #1 once it will create a solid shadow of 4 pixels 45 degree to the right. You can run LS #1 multiple times as per your desire to increase the length of the shadow. The output shadows aren't grouped.
LS #2 creates a much bigger shadow in a single run and takes more time to complete as it involves Duplicating the main Layer multiple times. The output shadows are grouped.
You have to use the LS#2 action as LS#1 is a support action for LS#2. And after that, you need to select the "Shadow" group and drag the opacity down to your desired value. I didn't set the opacity in the action itself so that users can set it according to themselves. You can also set your desired percentage of filling and Blending Options if you want.
Since it creates over 300 Duplicate Layers. it takes some time to complete the action.
Here's a short video tutorial.