When can I use coconut oil as a substitution for other fats?
It depends on the application: coconut oil is highly saturated compared to most vegetable oils, so it is more solid at room temperature.

If you are using it as a medium to saute or fry, this is not going to matter very much.

If you are using it a baked item, it may or may not depending on the item.  Most of the time in baked goods, you can substitute fats pretty freely, but you will get some change the in ultimate texture if you use a much more saturated fat.

In recipes which expect the oil to be liquid, you either have to melt the coconut oil before using it (if that is reasonably possible, for example in a muffin recipe), or not use it.

And of course, coconut oil may carry a slight flavor or aroma of coconuts.