Upvote:3
Travelling on separate tickets is always a risk. If a flight is delayed and you miss a connecting flight, then you are on your own as far as arranging alternative transportation (although travel insurance might help). You will also likely need to re-collect your bags in Cairo and re-check them for the next flight, which also means passing through immigration which will take time.
In general, 5.5 hours should be plenty of time. There is always the risk that the inbound flight will be significantly delayed, but it would need to be an extensive delay to leave you with insufficient time to make the connection.
A better option may be to contact Emirates and see if you can change your return flight to start in Jeddah, and go directly from there to Dubai. There will likely be a fee associated with this change, but you might find that it works out cheaper than buying the flights separately. This will mean one less flight, and no risk of being left to fend for yourself if something goes wrong.
Unrelated to the above, plan to get to Jeddah airport at least a few hours before your flight. I flew out of it a few weeks ago and lets just say it's not one of the world better airports...