The answer depends on the substance in question. For the sake of demonstration I will use pure water:
The first step is to determine how many moles there are. To do that we use Avagadro's number which is how many molecules there are per mole. The number is: 6.02×10^23 /mol.
To determined how many moles we have from the number of molecules we divide the number of molecules by Avagadro's number:
(5.0 x 10^24) / (6.02×10^23) = 8.3 mol
Next we can determine how many grams of water we have based on the molar mass of water.
Water is H20 so the molar mass of water = 2 times the molar mass of hydrogen plus the molar mass of oxygen.
molar mass hydrogen = 1.00794 g/mol
molar mass oxygen = 15.9994 g/mol
molar mass water = 2*(1.00794) + 15.9994 = 18.02 g/mol
Next to determine the number of grams of water we have we multiply the molar mass of water by the number of total moles:
Grams of water = 18.02 * 8.3 = 149.57 g
For water 1 g = 1mL therefore we have 149.57mL of water or 0.15L
In case of water the litre for 5*10^24 molecules is calculated.
One mole of of water( H2O ) molecules has the mass = (2+16 )gm.
Therefore one litre or 1000 cc of water with 1000 gm mass has = 1000/18 = 55.5555... mole of water molecules.
So 5*10^24 moles of water has (5*10^24 / Avogodro number ) moles = 5*10^24/(6.022*10^23) moles = 50/6.022 moles = 8.302889404 moles.
= 8.30289404/55.555555.. litres of water.
= 0.149452009 litre of water.