When is it worth adding nonbasic land or artifacts to your deck over basic land?
There are a variety of reasons that your would choose dual lands or basics or mana rocks, it largely depends on the specific deck. In general all dual lands (other than the originals like Tropical Island have some sort of downside compared to basics, usually entering the battlefield tapped (though sometimes with a way of getting around that limitation). Mana rocks again depend on the deck, but generally unless you are running a ramp deck, or at least have a specific thing you are ramping to you generally will not run them.

For reasons to run basics, obviously if you are just running a single color you are going to want all or mostly basics. If you are running cards like Grim Lavamancer  that care about cards in your graveyard you might run fetches along side them, and you could always choose to run utility lands like Ghost Quarter, but the only time in a mono-colored deck you would want to run any dual lands is if you have cards in your sideboard that are off color and you don't want to have too many lands in the sideboard too.

Another reason to run basics over duals is if you are running an aggro deck and all or most of the dual lands in the format enter the battlefield tapped. Exactly how many lands that enter tapped you are willing to run depends on a combination of the color requirements of your deck and the speed of the format. For example with Theros-Khans standard you might decide that with a Red/White aggro deck the only land that enter tapped that you can run is Temple of Triumph and adding Wind-Scarred Crag would slow the deck down too much.

The final main reason that you would choose to run basics is if there are cards that care about basic lands (or basic land types assuming neither original duals nor shock lands are available). For example currently with Khans of Tarkir there are fetch lands that get a land with one of two different basic land types, since there are no lands with basic land types other than basic lands in the format at the moment you would need to run some number of basic lands for the fetches to find. Other things that might care about basic land types are cards like Sunblade Elf and cards with the Domain mechanic.

Now for reasons to run dual lands, the most obvious reason is that you are running multiple colors and you need to have all of your colors consistently. For example if you are running Titanic Ultimatum and want to consistently cast it on turn 7 or 8 you are going to need to run a lot of dual lands to make sure you have all of the colors you need, but if your turn 7 play is instead Devout Invocation since it is much easier to cast color wise with only a single {W} in the cost you can get away with fewer duals.

Another reason to use duals is because they have some other ability in addition to making mana that you want, for example in Theros-Khans Standard there are the lands that Scry 1 when they enter, and the lands that gain you 1 life when they enter, if either of these are abilities your deck needs you might choose to run more of them than you would basics.

For mana rocks you generally only want to run them if there is something specific that you want to ramp into, and you have a time frame that you want to ramp into it by. For example in Zendikar-Scars Standard there was a deck that wanted to ramp into Primeval Titan by turn 4, to do this they need to ramp twice by turn 3 to help make this more consistent they ran Sphere of the Suns as some artifact ramp. In general though unless you have something specific to ramp into though playing mana rocks is taking time and mana away from playing spells that will actually advance your game plan and help you win.

For the question of whether to run duals or mana rocks in addition to or in place of basic lands it again depends slightly. For lands in your average deck you probably want 22-24 (possibly more or less depending on the specific deck, but that is a good place to start). From that starting place you would replace basics with dual lands to a point, there are very few decks that want to run no basics, just because having all of your lands entering the battlefield tapped means you are essentially playing the game a full turn behind your opponent. For artifacts you generally want to run them in addition to the lands you are running, this is because you are probably running a ramp deck and you want to make sure you hit everyone of you land drops in addition to the ramp you are playing, and if you don't hit your land drops your ramp is actually just keeping you where you should be if you had played a land instead of getting you ahead.