It's best to skip the gym for a day or two after getting a new tattoo. During that time, there may be bleeding or a secretion of fluids and that can be an entry point for bacteria. Plus, your body fluids shouldn't be shared with others. A tattoo is also a wound and needs to be protected. If you must hit the gym keep your tattoo covered with a gauze bandage. Follow all of your aftercare instructions for keeping your new piece of body art clean, moist, and protected from the sun.
If your tattoo is in an area that will be stretched or flexed a lot during a given exercise, it's best to put that exercise off for a few days. For example, running will flex and expand your calf muscles. This could be stressful for the new tattoo. Choose exercises that won't result in working the muscles next to the tattoo or flexing a joint that has a new tattoo.
Your tattoo artist may have recommendations as well, so don't be shy about asking for guidance.