Possible low transmission fluid, or a bad gear syncro. Check/add fluid first, if sound remains, verify you hear it only in one gear. If so, bring in for service.
If your fluid level is low, the transmission fluid can aerate and cause a whining sound in the pump assembly. Another reason could be a fractured bearing in the torque converter.
The transmission pump is probably not working correctly. This may mean you are low on transmission fluid, your filter is dirty, or the pump itself is bad. When you have the fluid changed, be sure to check for metal shavings.
The transmission pump is probably bad, which would cause a lack of transmission fluid making contact with the internal gears. The problem could also be a defective torque converter (in an automatic transmission).
Whining sound could be due to gears meshing in your transmission. First thing I would do is to check the transmission fluid. Is it dirty or even low. If it is dirty, take it in and get a full flush, if low, you're lucky, just fill it up.
Your transmission makes a whining sound when put into gear, because when the transmission starts to wear down the teeth on the gears start breaking off. When there is enough break off the cylinders try to turn each other and grind.