And if they do, how much damage can they take until the substitute dissapears?
Yes, a substitute has hp. The hp of the substitute is equal to 1/4 of the Pokemon's max hp stat. So if a Pokemon has 400 hp, the substitute would have 100 hp. Once the substitute takes 100 hp of damage, then it wears off. Source
it has 25% of the user's HP.
Using 25% of its maximum HP, the user creates a substitute with 1 HP more than the amount of HP lost by the user.
Source - Bulbapedia