You have a rouge app. Sort your app drawer by recent and look at the reviews of the first 5 apps that appear in that list. Check the low rating reviews and see if anyone is complaining about the issues you're having. Then decide what you are going to do about it.
Welcome to Android Central! Is the ad on the lockscreen, or is it a popup ad on your homescreen? Some annoying apps are starting to serve up ads on the lockscreen, like certain battery-saver apps or lockscreen apps.