It's pretty unlikely that your boss or teacher will tell you something generic like "you have two days" without also telling you the day of the week or date it's due.
But, if that were the case, you should ask for more specific information because there's no one correct answer.
Let's start with a couple of work examples.
- It's 9 am Monday. You're given a project and told "you have two days to complete this project".
This generally means you have two work days... so that means you have all day Monday and all day Tuesday. The project is due end of day Tuesday... usually meaning whenever you go home for the day (5 pm). You might be able to say it's due first thing Wednesday morning as that's effectively the same thing.
- It's 5 pm Monday and your boss gives you a project and tells you "you have two days to complete this project".
In this case, you're about to go home for the day, so this is your assignment for the next two days... Tuesday and Wednesday. The project is due end of business on Wednesday (or first thing Thursday morning).
In either example, the result is the same... two full work days to do the task.
Similarly, in a school situation, if the teacher gives you two days, that usually means you have two days from today... so if it's Monday, you have until your class period on Wednesday, although some teachers who allow digital submissions of work will give until midnight - this should be spelled out specifically by your teacher, though; don't expect it to be standard.
So, the "safe" bet is to take today's time and add 48 hours to it and assume that's when it's due.