It is optional (at least it has been at any hotel that I have ever been to; I suppose that there could be some places where it is mandatory, but that would be the exception rather than the rule).
Note, however, that self parking is not always free; there may be a charge whether you use valet or park yourself (in that case, valet is usually more expensive).
If this question refers to Disney properties, there is no charge for self parking and valet is optional (for Swan/Dolphin, there is a charge for self parking or valet).