When I want to say "take care" to somebody either orally or at the end of a letter what is the right expression? Can I use in gamba or stammi bene? Do they mean the same thing?
In gamba or stammi bene are the correct informal ways to say 'take care'.
Personally, when I want to wish 'take care' in Italian to somebody formally or in a less friendly way, I would say:
prenditi cura di te - si prenda cura di lei (courtesy form)
abbi cura di te - abbia cura di lei (courtesy form)
riguardati - si riguardi (courtesy form)
Hope this helps.