All of the links given are good answers. Since sometimes a different explanation may work best for someone, I offer the following.
Heat is energy transfer between objects (solids, liquids or gases) due solely to a temperature difference between the objects.
Work is energy transfer between objects due to a net force exerted by one object on another through a distance, or displacement.
Heat $Q$ and work $W$ are related to the change in internal energy $\Delta U$ of a system (solid, liquid or gas) by the first law of thermodynamics which can be written, for a closed system (no mass transfer) as
$$\Delta U=Q-W$$
Where $Q$ is positive for heat added to the system and $W$ is positive for work done by the system.
Think of a change in internal energy of a system as a change in the energy account balance due to energy transfers into or out of the account. Heat $Q$ transferred into the system or work $W$ done on the system are energy deposits, i.e., they increase the internal energy of the system. Heat transferred out of the system or when the system does work on something outside the system are energy withdrawals, i.e., they decrease the internal energy of the system.
Hope this helps.