I got my Lunatone to 5 hearts in Affection. If I don't keep petting and feeding it, will its Affection level decrease?
It doesn't as far as I know. I've been raising the affection level of some of my Pokemon since I started and have left some unattended; the affection level did not decrease over the ~70 hours of play time.
There's this site/blog which says (emphasis mine):
Do this five times and your Pokemon will have full Affection, meaning it will be more likely to avoid enemy attacks and will have more chance of landing Critical Hits in battle. This Affection will not decrease over time, so you needn't worry about maintaining it.
And quite a lot of forums on the internet saying the same thing, and I think you can find them easily without my help now!
I had my Shelgon at max hearts and out of nowhere he had no hearts and he has been the only one to faint in a while, but it happened a couple times in a row. So, I think fainting affects it also, but it seems to be the only thing. I've had max affection on all my pokemon since lvl 1. They are all lvl 48 now and have yet to drop a heart except for Shelgon just recently.
It shouldn't decrease if you leave it alone or place it in the pc box/daycare, but the hunger and enjoyment will usually go down. This shouldn't be too big of a problem, as that won't give you bonuses in battle and will only increase the affection (which you won't need, if it's already max). Perhaps it could go down if you let it faint or give it disliked berries, but it should be fine if you leave it on its own.
The game has said that it will not decrease, but the Pokemon will grow to hate you if it faints too often, you let it in a place it doesn't like, or give it disliked food... So technically it does decrease if you don't follow those..,
It actually does decrease over time, though not specifically because of time passing. Some of my Pokemon have decreased, but I've yet to figure out why.
The first I noticed was one of my Gardevoir. Oddly both her and her sister were both maxed out one after the other a couple weeks ago, but now the first one done is still at max while the second one done has rather suddenly dropped from 5 to 2 hearts.
The only theory that strikes me at the moment is that fainting may decrease it, because I've used the second one more than the first, in fact I've used her more than any other Pokemon recently. This of course means she's fainted more than any of the others.