What is the best opening that i should learn , And how much time should be spent on learning an opening?
If you're a beginner in chess I advise you to start off with opening that help develop your chess as they can evolve into multiple type of positions (90% of the time I advise beginners to start off with the Italian Game/Italian Opening).
If you're playing as black however, something like the French Defense would be advised... The Sicilian is too advanced for a beginner to learn cause most likely you won't be able to understand everything that is going on even if you know the lines of the Sicilian.
According to your comment, you like Queen's Gambit and the Ruy Lopez... Surprisingly enough both have very different play styles, Ruy Lopez being extremely offensive type of opening while the Queen's Gambit more tactical. However if you truly want to stick with either of those openings I suggest you stick to Ruy Lopez as it is not as complex as Queen's Gambit.
Here are other openings you might want to check out: Ponziani Opening, Scandinavian Defense(although I don't advise it since it breaks one of chess' principles, which is : don't bring the queen too early in the game).
However if you're more advanced you can go ahead and explore the Sicilian, King's Gambit, Queen's Gambit and King's Indian.
How much time you should spend on studying openings? Minimal... Openings are mostly a memorized sequence of moves which you understand better as you reach higher levels in chess, with somewhat solid knowledge of some openings you will won't have issues starting a game... But the moment you go into the middle game or if your opponent doesn't play according to the book (basically doesn't follow the normal lines of an opening) then your opening knowledge will help you very little in here, if not at all.
Most of your time in chess should be devoted to middle game and end game (the latter requiring most of your time as it is the hardest to master).
If you have any questions feel free to comment and I'll answer to the best of my abilities.