Im a self taught guitarist and I have been playing for some time, however I feel that most of my 'practice' has not been helping me in a way that I would want.

I have many problems when it comes to playing guitar and I feel like my basic fundamentals are not there.

I read quite abit online but my knowledge is pretty jumbled up.

First of all, I cannot recognize notes by hearing, this is something which frustrates me alot, I have tried a few excercises but none of them work for me. I believe this is very important. (same goes with chords)

Most of the time I learn my songs by ear by instinct and guessing, but it takes me some time.

Chords, I know how to play the open ones and a few bar chords, but how do I apply that into improvisation?
I know the 1 3 5 thing and how chords are derived from scales. But what do I do with it

Tempo has always been a problem for me when I play. I don't even count in my head when I play and thats a problem im not even sure how to count while playing.

Especially malmsteen solos where the note duration changes alot, how do you guys count that like seriously? and like maybe he holds this note for a nano second longer that kind of thing.

I also don't count when I improvise so I don't know how many bars im playing or whatever is going on but I keep to the speed of the tempo and it feels right. But I want to be in control of how many bars im playing.

Please give any advice or excercises to help me improve thanks.
If youre getting your theory info online from free sources it will most likely be confusing. I suggest taking some formal lessons, that should help with all of these issues.
For "theory" I have an organized, ground up, as well as comprehensive, series online here: http://lessons.mikedodge.com

It will walk you from the bottom to the top if read in this order:

Chord Construction
Diatonic Theory

Read the links at the site in that order as one picks up where the last one left off. Whether you're new to theory, or you need to "fill in the gaps" that site will help you with your overall understanding as well as specific understand of musical concepts and terminologies.

My suggestion is to read it one without the guitar in your hands, then read it again with the guitar in your hands, then read it one more time. Many of us who understand theory have either read the same book many times or have read multiple books contain the same common material. Repetition is the answer!!!