Can the energy transferred to a system as heat be saved completely as mechanical energy of the system? If energy is transferred to a system (as heat or work) and there is no transfer of energy from this system, then the energy transferred to the system will be saved as one of the forms of energy of the system i.e. increase the energy of the system (which may be thermal energy, mechanical energy, chemical energy etc). If the energy transfer was as work then this can be completely be saved as either mechanical energy of the system or thermal energy of the system (we won't consider other energy of the system). But if the energy transfer was as heat then this can be saved completely as the thermal energy of the system but the energy transferred cannot be completely be saved as mechanical energy. Is this the case or can the complete energy transferred to the system as heat can also be saved as mechanical energy of the system? (As mechanical energy can be completely be changed to work easily).
 A: Each type of energy is associated with a certain amount of entropy. For example, the mechanical energy, electricity, and laser light have low entropy. Other types of energy are not "entropy free", especially the heat energy.
Entropy can increase, but cannot decrease during the process of conversion of one type of energy to another. You can convert one low-entropy energy type to another and back with minimal technical losses, because this process does not conceptually change the entropy of the system. For example, you can convert electricity to the mechanical energy and back with little losses, such in hybrid electric cars.
You can also convert a low-entropy energy to a high-entropy energy. For example, an electric heater converts electricity to heat 100%. The same way friction converts the mechanical energy to heat 100%.
However, you cannot convert 100% of a high-entropy energy, such as heat, to a low-entropy energy, such as electricity or mechanical energy. This would contradict the law of the entropy increase. The total amount of entropy in the system must not decrease. For this reason, the efficiency of such a conversion would be limited. For example, the efficiency of an internal combustion engine in cars is only about 40% with the rest just heating the outside air.
So, to answer your question, we can store the heat energy in an insulated heated object, but we cannot completely convert heat to the mechanical energy. Accorging to the Carnot's theorem of thermodynamics, the maximum efficiency of a heat engine is:
$$\eta=1-\dfrac{T_c}{T_h}$$
Where $T_c$ is the temperature of the environment and $T_h$ is the temperature of the heater.
See Energy Conversion Efficiency and Thermal Efficiency
