I am new to bitcoin and was wondering with a single gtx 1050 mini 2gb how long would it take to get 1 bitcoin by myself?
You would never be able to mine a solo mine any Bitcoin with a GTX 1050. The current network difficulty is so high that your GPU would have an almost 0 probability of finding a block and thus earning any Bitcoin.
By yourself? That means: no mining pool? Then you have the chance to get 12.5 BTC + fees at the moment (not only 1 BTC).
But he probability that you will ever mine a block alone with your GPU is very, very, very low. The difficulty is too heigh. It's (almost) impossible. You will probably waste a lot of electricity and never get a bitcoin.
Mining (finding) BTC is basically random. Anyone who mines has a chance to find a block and get the reward (12.5+ BTC) So being optimistic, you have a chance, however, the probability of finding a block is directly related to the amount of hash power you have compared to the rest of the network mining power. Currently the total hash power of the entire BTC mining network is about 24 billion gigahash/second or 24,000 Picohash/sec. Your gtx1050 hash power is on the order of 10 Mh/s for sha256 (BTC mining algorithm). Your chance of finding a block on your own is 1 x 10^4/24 x 10^21 which is 24 x 10^17/sec. Multiply this out to years and that’s one in 76 billion years or as Andrew Chow above correctly says, “almost zero”. This also assumes mining difficulty never changes whereas in reality it’s increasing rapidly. Your electricity cost to mine would end up costing you more than it’s worth. With all that said, you could turn your rig on and hit tomorrow, but you’d be better off playing the Powerball lottery with 1 in 275 million chance of becoming a multimillionaire😀.