Depends on Why
Ideally, you will have no sensitivity after a filling.
However, there are may times when sensitivity does develop. It can be from several different things, so it's hard to say how long it will last. If it's slowly getting better, then just keep waiting to see if it eventually heals. If it doesn't improve, then more treatment will be needed. In most cases, a few weeks will take care of it.