It makes a huge difference - if you are talking about a puppy, my understanding is that they need to go out the number of hours as they are months old (that is, if they are two months old, they need to go out every two hours; if three months, every three hours, etc.
I think that stops when they are six months old, at which they can hold it for a full 8 hour day.
If you have a place the dog can eliminate, and he or she is already housebroken, then I believe they can stay at home alone for 8 -10 hours with no problem, as long as you give them quality time when you are home.