More often it means the sugar cube.
But we also use it to refer to candies.
As for lump of sugar ( which I guess is referring to that without a particular shape), we just say "糖". You could also use "糖块"，but that needs a more specific context.
Hope it's helpful to you !