You will need to use a separate query for each of your custom objects that is not a child in a master-detail relationship. So depending on the relationship types between your objects, that could be all your custom objects or just a few of them.
You can re-use the code for all the custom object types by using dynamic SOQL where the object name is varied from a list of object names.
If you want to go on and update the Owner to the new User then you will probably end up using a Batchable (if you are working in Apex) to stay within governor limits.
Obviously note Jesse Altman's point about researching side effects; I'm not sure what they might be for custom objects.