If you buy a PUT, you pay the premium. You'll lose that if your option expires out of the money.
If you sell a PUT, your exposure is much greater; you're the one who has to pay up if the option ends up in the money.
The deadline is the date of the option.
If you do lose money, it's a capital loss (tax benefit) and vice versa for capital gains.