Part of the magic of cream cheese lies in its versatility as an ingredient. You can use it as a spread, of course, but it can also be used in baked goods, dips, and even frosting. That's why the best substitute for cream cheese really depends on the recipe you're using. If you're looking for something that can replicate the texture of cream cheese that might be lower in fat when you're cooking or baking, AllRecipes recommends two different cream cheese substitutes: "1 cup pureed cottage cheese [or] 1 cup plain yogurt, strained overnight in a cheesecloth" for 1 cup of cream cheese. If you don't have a cheesecloth with which to strain yogurt, try a couple layers of paper towels.
What's nice about these cream cheese substitutes is that they're also versatile and can be used pretty much any way that regular old cream cheese is used, be it in a dip or as a spread or even as a thickener for a sauce or baked good.
But cream cheese can also add some sweetness, which is lacking in the cottage cheese or strained yogurt options. So if you're looking for a sweet cream cheese substitute, try mascarpone cheese. Mascarpone is naturally sweet with a smooth texture, though it is lighter than traditional cream cheese. But it's great for frostings or in desserts; after all, it's the cream used in tiramisu. You can also substitute in a high-quality ricotta cheese for cream cheese, though it will be firmer and with a more grainy texture. Ricotta will be better than mascarpone if you're looking for a baked goods-friendly cream cheese substitute.
Finding a dairy-free substitute for cream cheese is also pretty straightforward. There are plenty of tofu spreads with the consistency and even the flavor of cream cheese. (One of my personal favorites is Tofutti, which tastes especially good on fresh bagels.) Many of these dairy-free or vegan cream cheese substitutes are stable enough that they won't melt in the oven or over heat, which is a bonus.