I have a motion sensor in the ceiling to turn the lights on, it turns them on ok but won't turn them off until you turn the power off. Only just started
From your question I can make two assumptions:
1) It worked appropriately for a period of time (week, a month or longer).
2) There are very few settings, possibly one for duration and maybe one for sensitivity.
If neither of those are true, bring it back to the store and get a different unit.
If they are both true, try changing the sensitivity to a lower (less sensitive) setting and the duration to a longer setting. This will help to troubleshoot the unit and indicate whether there is some unknown motion that was too small to trip it previously but has become more significant. I had one in a hallway that tripped when the furnace came on and blew the tips of some flowers in a vase. If there weren't any flowers or they became dry, the motion sensor worked great but if there were fresh flowers it would trip (only when the furnace came on) - that almost drove me crazy!
I'm also assuming that you don't have a dog, cat, mouse, ferret, bat, bird, etc. that is running/flying through the room when you aren't looking.
If that doesn't take care of it, then replace the unit. You didn't say how you were using it either, but if it was to turn the light on when you entered the room (the switch is across the room) you might consider getting a motion sensor integrated into the switch rather than the ceiling. They tend to be a little higher quality, have better settings and easier to put in without a ladder.