As long as the landlord has given you at least 24 to 48 hours notice before the landlord inspection takes place then you cannot refuse to let the landlord in for the inspection.
It should be spelled out in your rental lease as to how often the landlord will be inspecting the apartment and in that lease it should say that you agree to landlord inspections.
If you don't let the landlord in for the inspection after they give you notice then you could be forced out of the apartment that you're renting by the landlord taking you to court.
An apartment or landlord inspection should take no more than 30 minutes to an hour but most landlord or apartment inspections take less than 30 minutes.
When I used to live in apartments the landlord inspections only took at most 25 minutes and then the landlord was gone.
The landlord should give you 24 hours notice prior to the landlord or apartment inspection so you can be prepared for the inspection.
If the landlord doesn't give you 24 hours prior notice for the landlord or apartment inspection then you can refuse it and tell them to come back after they give you notice.
The landlord just wants to make sure the apartment is in good condition and that no damage has been done.