H1B costs cannot be recovered, legally, as far as I know. Green card yes - because USCIS will then consider them as abusing the system; so we have to be employed for one year to show good cause. Usually it is only after you rceive that they worry about you leaving. If you leave before approval they may elect (though most cases they wouldnt worry) to revoke the application. They cannot ask you to pay.