> What is the relation between mean power and power spectral density? How to convert one to the other ?

The integral over the PSD is the power. That's it.

> For e.g. if my device uses a 2GHz bandwidth, how do I know how much power the device is allowed to transmit ? How to calculate it ?

2 GHz · -3 dBm/Hz = 93 dB + -3 dBm = 90 dBm = 1 MW.

Don't think you'll be able to build a megawatt transmitter! Also, it's forbidden, because you mustn't transmit more than -50 dBm on average. So, you're bound by both limits, and either one might kick in. 

You might, however, transmit a 1 ns pulse with a power of 1MW, then be silent for -50 dBm - 90 dBm = -140 dB of a nanosecond, so 50 dBs = 100,000 s = 11 days 13 hours 46 minutes 40 seconds.

More realistically, your PSD won't be flat – you're doing anything but a pulsed radar, after all. In that case, assigning of power might be implicit e.g. through transmitter symbol pulse shaping, or explicit, e.g. through subcarrier power allocations according to subcarrier SNR, for example employing the waterfilling algorithm.