I am going to answer you from an airline pilot point of view. First of all, parking brakes in aircraft work pretty similar to the ones in a car or a truck. And yes they are used to park the airplane by letting go off the toe brakes, which is again pretty similar to a road vehicle.
Once we are at the gate after a flight, we put on the parking brake and shut the aircraft down. The ground engineer usually lets us know through the intercom once the chocks are in place. This is a sort of 'okay' signal to release the parking brake. The reason why we use chocks and keep the parking brake off is mainly to cool down the brakes. Following a typical landing, and sometimes a long taxi to the gate, the brakes tend to heat up. Because airplanes rarely stay on the ground, we need to cool the brakes down to ensure they remain efficient in a possible rejected take off that might occur in the next flight. Keeping the parking brake off makes sure that the brake stators are released from the rotors, allowing better air flow circulation. This ensures proper heat dissipation. In some airplanes, we have brake fans, which helps to cool the brakes. The fan is more effective with the parking brake off. However, for the walkaround, we set the park brake on, even if the chocks are in place. This is so that we can get a more accurate indication of the brake wear indicators.
When the airplane has to be parked at a place for a long period of time, the parking brake can be kept on. But as the parking brake in most airplanes (when unpowered) is channeled through a pressurized hydraulic accumulator, it tends to slowly lose pressure. For example, the A320 accumulator can hold the brakes in place for about 12 hours. If you have to park it for more than 12 hours, you should place the chocks on the wheels to prevent it from moving and hitting something.

The A320 parking brake system. It is powered by the yellow hydraulic system and by an accumulator when the aircraft is off power.