When we press the keys on the piano that exist on the ends, one can notice that when we press a high pitch note, it plays for a short bit and then the sounds fades away. However, when we play a low pitch note, it keeps playing for a lot longer i.e we can hear it for much longer. Why don't both the low pitch and high pitch notes run for the same duration?
That's true not only for pianos, but for every (stringed) instrument, and the reason is basic physics.
When you hammer a string with a piano key, or pick it with your finger, or with a pick, etc. you impart a certain amount of energy to it, depending on how hard you hit it -- the harder you hit it, the more energy you give it.
Next, you should know that given the same amplitude of vibration, higher frequencies contain more energy than lower frequencies (the string vibrates more often in the same amount of time).
Therefore, if you impart the same energy to two different strings (or to the same string with different lengths), the string that vibrates at a higher frequency will dissipate the energy faster (higher frequency requires more energy) while the same energy on a lower frequency string will dissipate less energy in the same amount of time, and therefore the sound will last longer.
In other words, the total amount of energy dissipated will be the same, but a higher pitched string will dissipate it faster (and therefore last a shorter time) while a lower pitched string will dissipate its energy more slowly and therefore last a longer time.
You can easily test it on a guitar: choose any string, and the first pluck the open string, and let it play. Then fret the string at the highest fret, pluck it with the same force, and note how long that plays. The difference should be pretty obvious.
There is a lot of half answers provided and frankly some of the information is ambiguous, possibly false.
The question itself is not complete enough to elicit an answer. The best I can do is provide a bunch of information that I think is relevant to the discussion and hope that it helps.
Using the simple ideal model for a vibrating string, vibrating plates, etc, the linear damping force is proportional to the velocity of a mass element of the string. When the equations are expressed in the frequency domain this is proportional to the frequency of the wave propagating on the string. From this it is reasonable to conclude that the higher harmonics in a single wave packet will die faster than the fundamental. This is commonly observed in isolated systems. After some time the fundamental is the only noticeable frequency left. The conclusion is also valid comparing fundamentals of different strings.
One has to understand where this relation comes from. There are at least two sources of damping that I can think of for the near ideal string mounted on ideal rigid supports. The first is air resistance of the string moving through the air. This second is internal damping due to the vibrations of the material within the string. In other words energy of the transverse mode (the ideal model) is lost in longitudinal modes in the material and heats it up, increases entropy etc. These are both pretty small but not completely zero.
The first critique of this is that true strings also have stiffness in them and obey higher order differential equations than the ideal string. This does not change the above arguments but contributes to dissonant overtones that are not in the harmonic sequence, fn = n*f1.
Energy is eventually lost from the string to the body of the instrument and eventually to the air as acoustic sound. If this were not possible we would not be able to hear the instrument. This introduces a whole new set of equations, couplings, and physics to consider. The top of a guitar for example would obey a set of equations for stiff plates. They have their own natural harmonics that may or may not be aligned with those of the strings. Part of Luthier's art is optimizing this. So depending on the quality of the instrument and its condition some notes may get amplified more than others. This is a ver