Not at all. It's relatively easy to earn Dilithium via Exploration/Strange New Worlds, PvP/Warzones, etc. It's not going to be something you're going to earn in a day of playing, though. Depending on your character's Rank it might take you a couple of weeks or a month or more. There's no way of knowing, as I don't know how much you play per day/week, etc.
Earning dilithium starts to get progressively easier as you level due to an increasing number of dilithium sources, such as daily quests, pve events and doffing.
I may be mistaken, but you don't need to unlock a new character slot for Foundry use as everyone gets space to create a foundry character. Perhaps you mean the purchase of foundry project slots - in order to create missions?
Keep in mind that in addition to the Dilithium to zen you need to get the character slot, you will also need 10,000 dilithium to get the access to the foundry itself. (this 10K is for the project slots. which you have to have before you can create your foundry character.)
May the Prophets guide us in these cryptic times....