There are 2 ways, while both do the same for your situation i believe the direct setting of values may be faster, but painting weights can be more intuitive and should be better for detailed weighting in special situations.
- Go in "Weight Paint" mode (for visual feedback, as it allows to see what happens by displaying the colors as you set the values)
- Select all the vertices that you want to use in the pin-group
- Create a Vertex Group and assign all the vertices to it by pressing the assign button.
- Now select each line and set the value that line of vertices should have in the "Weight" Field under the "Assign" button.
- In the documentation it says that "Assign" is additive, but that does not mean the weight value will be added, it just means the vertices will be added to the group if they are not already in it.
- After all lines of vertices are set, you should have a gradient showing the weights going from top to bottom.
- In the cloth panel, under shape, you will have to adjust the "Stiffness" to make the weighting show more or less effect (i used 0.01 in the example).
Here a simple visualisation of the steps and a final cloth sim result:
Update (thanks for pointing it out @atomicbezierslinger):
Important to note though is that if you use a tablet, and have MMB emulation on, you won't be able to use the function without either changing the keymap or deactivating the emulation.