It depends on what food it is, how long the bag has been open (it its been open), where it was kept (temp, humidity, etc), and other factors, but generally I'd be comfortable feeding "expired" kibbled for several months after the sell-by date.
itlls keep even longer than 6 months after if the bags sealed, ive seen tests that show if its kept in a freezer dry food will last up to 24 months after expiration, possibly longer.