You should park at least 15 feet away from a fire hydrant in most jurisdictions. This means you cannot stop or park your vehicle within 15 feet on either side of a hydrant. In some places the required distance might be 10 feet, but 15 feet is a very common rule (for example, it’s 15 feet in California, New York, Texas, and many other states).
Often, the curb will be painted a specific color (like red) near a hydrant to indicate no parking, or there might be signage. Even if it isn’t marked, the law still applies. Fifteen feet is roughly the length of an average car. The reason for this rule is to ensure that in the event of a fire, fire trucks can have clear access to the hydrant. They may need to park near it and will definitely need to connect a hose to it, possibly running the hose across where a car might be if it’s parked too close. If you park too close to a hydrant, not only could you get a ticket (fines for this are often around $100 or more), but in an emergency, firefighters will literally do whatever is necessary to get to the water – including breaking your car’s windows to run a hose through or damaging the vehicle to move it.
So, as a rule: always leave at least 15 feet of clearance when parking near a fire hydrant. It’s a good idea to use a bit more than the minimum, to be safe. It’s not worth the risk of a fine or hindering firefighters during an emergency.